Skip to content

Conversation

@tmszi
Copy link
Member

@tmszi tmszi commented Jun 7, 2022

Describe the bug
wxGUI Cartographic Composer preview image doesn't rendered on OS MS Windows platform.

To Reproduce
Steps to reproduce the behavior:

  1. Download and install e.g. WinGRASS-8.3.dev
  2. Launch wxGUI Cartographic Composer g.gui.psmap
  3. Add Map frame and choose some raster map e.g. elevation
  4. Push toolbar Show preview (green triangle) tool
  5. See error
Traceback (most recent call last):
  File "C:\Program Files\GRASS GIS 8.3\gui\wxpython\psmap\frame.py", line 482, in OnCmdDone
    im.save(self.imgName, format="PNG")
  File "C:\Program Files\GRASS GIS 8.3\Python39\lib\site-packages\PIL\Image.py", line 2117, in save
    self._ensure_mutable()
  File "C:\Program Files\GRASS GIS 8.3\Python39\lib\site-packages\PIL\Image.py", line 619, in _ensure_mutable
    self._copy()
  File "C:\Program Files\GRASS GIS 8.3\Python39\lib\site-packages\PIL\Image.py", line 612, in _copy
    self.load()
  File "C:\Program Files\GRASS GIS 8.3\gui\wxpython\psmap\utils.py", line 465, in loadPSForWindows
    self.im = GhostscriptForWindows(self.tile, self.size, self.fp)
  File "C:\Program Files\GRASS GIS 8.3\gui\wxpython\psmap\utils.py", line 492, in GhostscriptForWindows
    command = string.join(command)
AttributeError: module 'string' has no attribute 'join'

Expected behavior
Preview image should be rendered as on other OS platforms.

System description:

  • Operating System: MS Windows
  • GRASS GIS version: all versions

Additional context
I tried to fix the error above, including a function GhostscriptForWindows

def GhostscriptForWindows(tile, size, fp):
that didn't work (need much more code changes), but I found that this function isn't needed and the preview works without it (PIL module has ability to load EPS file directly, without using Ghostscript image rendering).

…ering on OS MS Windows platform

PIL module has ability to load EPS file directly on this platform.
@tmszi tmszi added bug Something isn't working windows Microsoft Windows specific GUI wxGUI related labels Jun 7, 2022
@tmszi tmszi added this to the 8.2.1 milestone Jun 7, 2022
Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great the workaround is not needed any more, thank you for fixing it.

@tmszi tmszi merged commit 5995c7d into OSGeo:main Jun 8, 2022
tmszi added a commit that referenced this pull request Jun 8, 2022
…ering on OS MS Windows platform (#2419)

PIL module has ability to load EPS file directly on this platform.
tmszi added a commit to tmszi/grass that referenced this pull request Jun 8, 2022
…ering on OS MS Windows platform (OSGeo#2419)

PIL module has ability to load EPS file directly on this platform.
@tmszi tmszi deleted the wxgui_psmap_fix_make_preview_on_os_ms_win branch June 8, 2022 13:39
tmszi added a commit to tmszi/grass that referenced this pull request Jun 10, 2022
…ering on OS MS Windows platform (OSGeo#2419)

PIL module has ability to load EPS file directly on this platform.
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
…ering on OS MS Windows platform (OSGeo#2419)

PIL module has ability to load EPS file directly on this platform.
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
…ering on OS MS Windows platform (OSGeo#2419)

PIL module has ability to load EPS file directly on this platform.
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
…ering on OS MS Windows platform (OSGeo#2419)

PIL module has ability to load EPS file directly on this platform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working GUI wxGUI related windows Microsoft Windows specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants