Opened 7 years ago

Closed 7 years ago

#2135 closed defect (fixed)

wxGUI: failed to show legend when PIL is missing

Reported by: martinl Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: wxGUI Version: unspecified
Keywords: legend, PIL Cc:
CPU: x86-64 Platform: Linux

Description

It's not possible to show legend when PIL package is not available, see traceback bellow

 File "/opt/src/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/gui/wxpython/mapdisp/frame.py", line 187, in <lambda>
    overlay.overlayChanged.connect(lambda: self.MapWindow2D.UpdateMap(render=False, renderVector=False))
  File "/opt/src/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/gui/wxpython/mapwin/buffered.py", line 720, in UpdateMap
    for img in self.GetOverlay():
  File "/opt/src/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/gui/wxpython/mapwin/buffered.py", line 601, in GetOverlay
    img = utils.autoCropImageFromFile(overlay.mapfile)
  File "/opt/src/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/gui/wxpython/core/utils.py", line 1103, in autoCropImageFromFile
    from PIL import Image

Change History (5)

comment:1 Changed 7 years ago by annakrat

I added special handling of missing PIL in r58256 (with advice to install it), however we should decide if PIL is a official requirement for wxGUI. Now it's used for cropping overlays (legend and so) so that you can move more decorations easily.

comment:2 in reply to:  1 ; Changed 7 years ago by hamish

Replying to annakrat:

however we should decide if PIL is a official requirement for wxGUI.Now it's used for cropping overlays (legend and so) so that you can move more decorations easily.

fwiw it is already "encouraged", since if PIL is there the wxGUI PsMap? and Animation tools like to use it too.

Hamish

comment:3 in reply to:  2 ; Changed 7 years ago by annakrat

Replying to hamish:

Replying to annakrat:

however we should decide if PIL is a official requirement for wxGUI.Now it's used for cropping overlays (legend and so) so that you can move more decorations easily.

fwiw it is already "encouraged", since if PIL is there the wxGUI PsMap? and Animation tools like to use it too.

Animation tool uses PIL for the same reason as map Window now - trim legend so that you can move it around the screen easily.

Can we close this?

comment:4 in reply to:  3 Changed 7 years ago by martinl

Replying to annakrat:

Can we close this?

For me - yes.

comment:5 Changed 7 years ago by annakrat

Resolution: fixed
Status: newclosed

I also updated REQUIREMENTS.html and gui/wxPython/README (r58282).

Note: See TracTickets for help on using tickets.