[GRASS-dev] [GRASS GIS] #3617: save display to image button broken

#3617: save display to image button broken
-------------------------+-------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Keywords: | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
The save display to image button is now broken in GRASS 7.4.1 and up. It
works in 7.2.2.

It produces the following error:

Traceback (most recent call last):
   File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/mapdisp/frame.py", line 626, in SaveToFile

filetype, ltype = self._prepareSaveToFile()
   File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/mapdisp/frame.py", line 802, in _prepareSaveToFile

filetype, ltype = GetImageHandlers(img)
   File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/gui_core/dialogs.py", line 1834, in GetImageHandlers

for h in image.GetHandlers():
AttributeError
:
'Image' object has no attribute 'GetHandlers'

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by cmbarton):

Because the cartographic composer doesn't work either in 7.4.1 and above,
I'm escalating this to blocker because there is no way to get a map image
out of GRASS.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by cmbarton):

* priority: major => blocker

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Description changed by neteler:

Old description:

The save display to image button is now broken in GRASS 7.4.1 and up. It
works in 7.2.2.

It produces the following error:

Traceback (most recent call last):
  File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/mapdisp/frame.py", line 626, in SaveToFile

filetype, ltype = self._prepareSaveToFile()
  File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/mapdisp/frame.py", line 802, in _prepareSaveToFile

filetype, ltype = GetImageHandlers(img)
  File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/gui_core/dialogs.py", line 1834, in GetImageHandlers

for h in image.GetHandlers():
AttributeError
:
'Image' object has no attribute 'GetHandlers'

New description:

The save display to image button is now broken in GRASS 7.4.1 and up. It
works in 7.2.2.

It produces the following error:

{{{
Traceback (most recent call last):
   File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/mapdisp/frame.py", line 626, in SaveToFile

filetype, ltype = self._prepareSaveToFile()
   File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/mapdisp/frame.py", line 802, in _prepareSaveToFile

filetype, ltype = GetImageHandlers(img)
   File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/gui_core/dialogs.py", line 1834, in GetImageHandlers

for h in image.GetHandlers():
AttributeError
:
'Image' object has no attribute 'GetHandlers'
}}}

--

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by neteler):

The function `def GetImageHandlers(image):` in
gui/wxpython/gui_core/dialogs.py is identical between 7.2 and 7.5...

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by cmbarton):

I've tested on a couple of different machines and get the same results.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by annakrat):

The problem happens only with wxPython4, the method is simply not there.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by cmbarton):

there must be some kind of method for spacing. Is it using a different
one? Is it needed in this case?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:7&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by veroandreo):

* Attachment "grass7.4_doutfile_3.png" added.

Full error message from d.out.file in GRASS 7.4.1 run in a Mac os sierra
10.12.6 (contributed by Carol Garzon)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by veroandreo):

I have just attached the full error message obtained when trying to save a
map display in GRASS GIS 7.4.1 from a Mac OS Sierra 10.12.6 (hope it is
readable). The screenshot was kindly contributed by Carol Garzon, she has
tested both from GUI and CLI with same results. She confirms the error was
not there in GRASS 7.4.0.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:8&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by veroandreo):

Just in case the message is not readable from the image, here's the ascii
text provided by Carol Garzon:

{{{
GRASS 7.4.1 (panamania):~ > d.mon wx1
GRASS 7.4.1 (panamania):~ > d.vect Bufpuntos
d.vect completo.
GRASS 7.4.1 (panamania):~ > d.out.file output=intento format=png
GRASS 7.4.1 (panamania):~ > Traceback (most recent call last):
   File "/Applications/GRASS-7.4.1.app/Contents/Resources/lib/python2.7
/site-packages/wx/core.py", line 2158, in Notify
     self.notify()
   File
"/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/mapdisp/main.py",
line 590, in watcher
     self.mapFrm.GetMap().GetLayersFromCmdFile()
   File
"/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/mapdisp/main.py",
line 137, in GetLayersFromCmdFile
     self.saveToFile.emit(cmd=utils.split(dCmd))
   File
"/Applications/GRASS-7.4.1.app/Contents/Resources/etc/python/grass/pydispatch/signal.py",
line 229, in emit
     dispatcher.send(signal=self, *args, **kwargs)
   File
"/Applications/GRASS-7.4.1.app/Contents/Resources/etc/python/grass/pydispatch/dispatcher.py",
line 349, in send
     **named
   File
"/Applications/GRASS-7.4.1.app/Contents/Resources/etc/python/grass/pydispatch/robustapply.py",
line 60, in robustApply
     return receiver(*arguments, **named)
   File
"/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/mapdisp/main.py",
line 548, in <lambda>
     self.Map.saveToFile.connect(lambda cmd: self.mapFrm.DOutFile(cmd))
   File
"/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/mapdisp/frame.py",
line 667, in DOutFile
     filetype, ltype = self._prepareSaveToFile()
   File
"/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/mapdisp/frame.py",
line 802, in _prepareSaveToFile
     filetype, ltype = GetImageHandlers(img)
   File
"/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gui_core/dialogs.py",
line 1832, in GetImageHandlers
     for h in image.GetHandlers():
AttributeError: 'Image' object has no attribute 'GetHandlers'
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:9&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by cmbarton):

This might be very easy to fix it.

I just found out that in the same version of trunk where save output does
not work for 2D, it works fine for 3D. We just need to use the 3D code
(and add some additional output formats) for this to work.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:10&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: fixed | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by annakrat):

* status: new => closed
* resolution: => fixed

Comment:

In [changeset:"73231" 73231]:
{{{
#!CommitTicketReference repository="" revision="73231"
wxGUI: wx4 doesn't have Image.GetHandlers, fixes #3617
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:11&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: fixed | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by annakrat):

In [changeset:"73232" 73232]:
{{{
#!CommitTicketReference repository="" revision="73232"
wxGUI: wx4 doesn't have Image.GetHandlers, fixes #3617 (merged from
releasbranch 76)
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:12&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: reopened
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by cmbarton):

* status: closed => reopened
* resolution: fixed =>

Comment:

Sadly, this is still not fixed. The dialog now appears and you can select
a file name and place to save it. But when you click save, it sits
endlessly saying "please wait, exporting image". Nothing is being written.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:13&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: reopened
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by annakrat):

Try r73323.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:14&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: fixed | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by cmbarton):

* status: reopened => closed
* resolution: => fixed

Comment:

Yes. This is fixed now. Thanks!!!

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:15&gt;
GRASS GIS <https://grass.osgeo.org>

#3617: save display to image button broken
--------------------------+-------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.4.2
Component: wxGUI | Version: unspecified
Resolution: fixed | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by annakrat):

Backported to 7.6 and 7.4

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3617#comment:16&gt;
GRASS GIS <https://grass.osgeo.org>