Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxGUI/psmap: Ghostscript HyperlinkDialog is needed #2441

Merged

Conversation

tmszi
Copy link
Member

@tmszi tmszi commented Jun 16, 2022

Revert back PR #2421.

Describe the bug
If Ghostscript program isn't available on the OS MS Windows, error is printed to the stdout.

To Reproduce
Steps to reproduce the behavior:

  1. Download and install e.g. WinGRASS-8.3.dev
  2. If you have installed Ghostscript, uninstall it
  3. Launch wxGUI Cartographic Composer g.gui.psmap
  4. Click on the Show preview toolbar tool (green "play button")
  5. See error
Traceback (most recent call last):
  File "C:\Program Files\GRASS GIS 8.3\gui\wxpython\psmap\frame.py", line 484, 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\Python39\lib\site-packages\PIL\EpsImagePlugin.py", line 332, in load
    self.im = Ghostscript(self.tile, self.size, self.fp, scale)
  File "C:\Program Files\GRASS GIS 8.3\Python39\lib\site-packages\PIL\EpsImagePlugin.py", line 134, in Ghostscript
    raise OSError("Unable to locate Ghostscript on paths")
OSError: Unable to locate Ghostscript on paths

Expected behavior
Show Hyperlink dialog with correct label and hyperlink if Ghostscript program isn't available.

wxgui_psmap_ghostscript_hyperlinkdialog_exp

System description (please complete the following information):

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

Additional context
For reading EPS file, PIL require Ghostscript program to be installed.

@tmszi tmszi added bug Something isn't working backport_needed windows Microsoft Windows specific GUI wxGUI related labels Jun 16, 2022
@tmszi tmszi added this to the 8.2.1 milestone Jun 16, 2022
@tmszi tmszi changed the title wxGUI/psmap: Ghostscript HyperdialogLink is needed wxGUI/psmap: Ghostscript HyperlinkDialog is needed Jun 16, 2022
@tmszi tmszi force-pushed the wxgui_psmap_revert_back_missing_gs_hyperlink_dlg branch from f3a8d5d to 2dc2565 Compare June 19, 2022 18:32
@tmszi
Copy link
Member Author

tmszi commented Jun 19, 2022

Rebase 2dc2565.

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.

Looks fine!

"You can donwload {program} {arch} version here."
).format(
program=program,
arch="64bit" if "64" in program else "32Bit",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
arch="64bit" if "64" in program else "32Bit",
arch="64bit" if "64" in program else "32bit",

@tmszi tmszi merged commit 41891f3 into OSGeo:main Jul 19, 2022
@tmszi tmszi deleted the wxgui_psmap_revert_back_missing_gs_hyperlink_dlg branch July 19, 2022 06:11
tmszi added a commit to tmszi/grass that referenced this pull request Jul 19, 2022
tmszi added a commit to tmszi/grass that referenced this pull request Jul 19, 2022
tmszi added a commit to tmszi/grass that referenced this pull request Jul 19, 2022
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
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.

None yet

2 participants