Opened 16 months ago

Closed 14 months ago

Last modified 14 months ago

#3617 closed defect (fixed)

save display to image button broken

Reported by: cmbarton Owned by: grass-dev@…
Priority: blocker Milestone: 7.4.2
Component: wxGUI Version: unspecified
Keywords: Cc:
CPU: Unspecified Platform: Unspecified

Description (last modified by neteler)

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'

Attachments (1)

grass7.4_doutfile_3.png (519.6 KB) - added by veroandreo 15 months ago.
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)

Download all attachments as: .zip

Change History (17)

comment:1 Changed 15 months ago 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.

comment:2 Changed 15 months ago by cmbarton

Priority: majorblocker

comment:3 Changed 15 months ago by neteler

Description: modified (diff)

comment:4 Changed 15 months ago by neteler

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

comment:5 Changed 15 months ago by cmbarton

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

comment:6 Changed 15 months ago by annakrat

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

comment:7 Changed 15 months ago by cmbarton

GetHandlers? a custom handler for GRASS or a specific wxPython one? If the latter, there must be some kind of wxP 4 feature that accomplishes the same thing.

Last edited 15 months ago by cmbarton (previous) (diff)

Changed 15 months ago 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)

comment:8 Changed 15 months ago 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.

comment:9 Changed 15 months ago 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'

comment:10 Changed 15 months ago 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.

comment:11 Changed 15 months ago by annakrat

Resolution: fixed
Status: newclosed

In 73231:

wxGUI: wx4 doesn't have Image.GetHandlers?, fixes #3617

comment:12 Changed 15 months ago by annakrat

In 73232:

wxGUI: wx4 doesn't have Image.GetHandlers?, fixes #3617 (merged from releasbranch 76)

comment:13 Changed 14 months ago by cmbarton

Resolution: fixed
Status: closedreopened

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.

comment:14 Changed 14 months ago by annakrat

Try r73323.

comment:15 Changed 14 months ago by cmbarton

Resolution: fixed
Status: reopenedclosed

Yes. This is fixed now. Thanks!!!

comment:16 Changed 14 months ago by annakrat

Backported to 7.6 and 7.4

Note: See TracTickets for help on using tickets.