Ghostscript on Windows x64

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
mootools
Posts: 19
Joined: 2005-06-30T06:08:40-07:00
Location: France

Ghostscript on Windows x64

Post by mootools » 2011-10-18T00:20:36-07:00

Hello,

I am currently trying using Ghostscript under Windows x32 and x64 bits platform.
I use x32 and x64 bits version of ImageMagick for my application.

I found a bug in the nt-base.c for retrieving the ghostscript setup path.

in file nt-base.c NTLocateGhostscript function the following code should be removed:
#if defined(KEY_WOW64_32KEY)
mode|=KEY_WOW64_32KEY;
#endif

Explanation:

On a x32 bits system
Removing the line has no incidence.

On a x64 bits system

Please refer to Registry Reflection under MSDN.

-> Compiling x32 ImageMagick : ImageMagick should retrieve Ghostscript x32 setup keys in order to be able to load the x32 bits ghostscript dll
Registry reflection is automatic. RegOpenKeyExA automatically opens keys under \Software\Wow6432Node

-> Compiling x64 ImageMagick : ImageMagick should retrieve Ghostscript x64 setup keys in order to be able to load the x64 bits ghostscript dll
RegOpenKeyExA automatically opens keys under Wow6432Node \Software\
if you set mode|=KEY_WOW64_32KEY; the \Software\Wow6432Node key will be retrieve even for x64 bits ImageMagick.
And so, NTLocateGhostscript will retrieve the setup path for x32 bits Ghostscript package.
ImageMagick x64bits will then try to load the ghoscript x32 dll which is not possible.

I hope everything is clear. Let me know I can give further help if needed,

Manuel Jouglet
Mootools
Manuel Jouglet
Mootools

User avatar
magick
Site Admin
Posts: 11042
Joined: 2003-05-31T11:32:55-07:00

Re: Ghostscript on Windows x64

Post by magick » 2011-10-18T04:15:28-07:00

Thanks for the problem report and explanation. We'll get the patch into the next point release of ImageMagick.

Post Reply