Opened 6 years ago

Closed 6 years ago

Last modified 6 years 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 6 years 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 by cmbarton, 6 years ago

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 by cmbarton, 6 years ago

Priority: majorblocker

comment:3 by neteler, 6 years ago

Description: modified (diff)

comment:4 by neteler, 6 years ago

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

comment:5 by cmbarton, 6 years ago

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

comment:6 by annakrat, 6 years ago

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

comment:7 by cmbarton, 6 years ago

Version 1, edited 6 years ago by cmbarton (previous) (next) (diff)

by veroandreo, 6 years ago

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 by veroandreo, 6 years ago

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 by veroandreo, 6 years ago

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 by cmbarton, 6 years ago

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 by annakrat, 6 years ago

Resolution: fixed
Status: newclosed

In 73231:

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

comment:12 by annakrat, 6 years ago

In 73232:

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

comment:13 by cmbarton, 6 years ago

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 by annakrat, 6 years ago

Try r73323.

comment:15 by cmbarton, 6 years ago

Resolution: fixed
Status: reopenedclosed

Yes. This is fixed now. Thanks!!!

comment:16 by annakrat, 6 years ago

Backported to 7.6 and 7.4

Note: See TracTickets for help on using tickets.