GraphicsMagick can't open Ghostscript registry key

48 Views Asked by At

I'm trying to use GraphicsMagick on Windows to watermark images and pdf's. Using version 1.3.41. I also installed Ghostscript and the fonts, as per the readme. However, I still get an error that GraphicsMagick can't find the ghostscript font.

The command I use is: gm convert logo.jpg -debug -fill "red" -pointsize 30 -draw "text 10,10 'Sample Watermark'" output.jpg

With debugging on it says:

11:54:07 0:0.057157  0.000u 1692 nt_base.c/NTGhostscriptFind/1414/Configure:
  RegOpenKeyExA() failed to open "HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript" (The system cannot find the file specified.)

However when I look in my registry that key is there! It also has the subkey 10.02.0 with the necessary keyvalues in it.

I checked the source of GraphicsMagick (http://hg.code.sf.net/p/graphicsmagick/code/file/7bab2a506b65/magick/nt_base.c line 1414), but couldn't find anything revelant. The versioning scheme of Ghostscript was patched already a long time ago in GraphicsMagick, so that can't be the issue. It seems that the Windows command to open the registry key gives an error, but I can't figure out why.

1

There are 1 best solutions below

0
Nicolas Mommaerts On

Ok I found a workaround. Turns out that that key also existed in "HKEY_CURRENT_USER" but not with the values that GraphicsMagick expects. I copied the ones from the "HKEY_LOCAL_MACHINE" location and now it did pick it up.Still feels like a bug though.