Problem with delegates.xml configuration

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Nico80

Problem with delegates.xml configuration

Post by Nico80 »

Hi,

I work under Windows and I try to convert a .ps document to a .png image. I know i need Ghostscript in order to decode postscript. My problem is that my ghostscript commands are not in my PATH and i can't add them (I use a copy/paste version of the ghostscript directory, can't make a real installation for several reasons).

I've searched the forum and it seems I need to configure the delegates.xml with the local path of my ghostscript executable.
Delegates.xml seems to reference the gs command by @PSDelegate@, so I tried to remplace it with C:\gs\gs8.54\bin\gswin32c.exe (my GS directory) but it just doesn't work.

Code: Select all

convert -density 400 -resize 40% -quality 100 c:\my_file.ps c:\my_file.png
return me this error:

Code: Select all

convert: `%s': %s "C:/Program Files/gs/gs8.54/bin/gswin32c.exe" -q -dBATCH -dSAF
ER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 "-sDEVICE=pnmraw" -dTextAlp
haBits=4 -dGraphicsAlphaBits=4 "-g2033x178" "-r400x400"  "-sOutputFile=C:/DOCUME
~1/myprofile/LOCALS~1/Temp/magick-SLv3GuMq" "-fC:/DOCUME~1/myprofile/LOCALS~1/Temp/magick-
Y.hdXGDR" "-fC:/DOCUME~1/myprofile/LOCALS~1/Temp/magick-h5I4394x".

convert: `%s': %s "C:/Program Files/gs/gs8.54/bin/gswin32c.exe" -q -dBATCH -dSAF
ER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 "-sDEVICE=pnmraw" -dTextAlp
haBits=4 -dGraphicsAlphaBits=4 "-g2033x178" "-r400x400"  "-sOutputFile=C:/DOCUME
~1/myprofile/LOCALS~1/Temp/magick-SLv3GuMq" "-fC:/DOCUME~1/myprofile/LOCALS~1/Temp/magick-
Y.hdXGDR" "-fC:/DOCUME~1/myprofile/LOCALS~1/Temp/magick-h5I4394x" -c showpage.

convert: no decode delegate for this image format `c:\inetpub\wwwroot\doc\test_l
atex.ps'.
convert: Postscript delegate failed `c:\my_file.ps';
convert: missing an image filename `c:\my_file.png'.
According to this error Imagemagick try to access GS at "C:/Program Files/gs/gs8.54/bin/gswin32c.exe", but i don't know why it wants to use this directory since it's not the one i've written in the delegates.xml.( is it a default location?).

So how to tell Imagemagick to use the paths written in delegates.xml?
And what is the exact line to add/modify to link my GS directory?

I'd be grateful to anyone who could help me.
(Excuse my english, I've done my best ^^)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

ImageMagick consults the Windows registry to determine where to find Ghostscript. You may need to uninstall and then reinstall Ghostscript so that ImageMagick picks up the right Windows registry entries for Ghostscript.
Nico80

Post by Nico80 »

magick wrote: ImageMagick consults the Windows registry to determine where to find Ghostscript. You may need to uninstall and then reinstall Ghostscript so that ImageMagick picks up the right Windows registry entries for Ghostscript.

Thanks for the help. :)
But it seems you missed my point. I think my post wasnt clear enough.^^
Like I said, i don't use (and can't use) a true "installation" of Ghostscript, Gs directory is on the disk (I pasted it) and Windows is not aware of it.
I just wanted to know how I could tell ImageMagick that I use a custom path to GS. According to some other topics, it seems that delegates.xml what designed for this purpose.
In short, can we tell Imagemagick to use a custom path to GS and how do you do it?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

It appears Ghostscript is in your Windows registry. If it is, ImageMagick uses that Ghostscript version. It only checks the delegates.xml configuration file if it does not find a Windows registry entry for Ghostscript.
Nico80

Post by Nico80 »

magick wrote: It appears Ghostscript is in your Windows registry. If it is, ImageMagick uses that Ghostscript version. It only checks the delegates.xml configuration file if it does not find a Windows registry entry for Ghostscript.


I've cleaned my registery and now get this error:

Code: Select all

convert.exe: no decode delegate for this image format 'c:\myfile.ps'
convert.exe: missing an image filename 'c:\myfile.png'
It seems that Imagemagick still don't use delegates.xml.
Here is my version of delegates.xml, like i said earlier, I tried to remplace all "@PSDelegate@" by my gs directory "C:\gs\gs8.54\bin\gswin32c.exe ".

>>delegates.xml<<

Is it the right thing to do? Did I miss something? A new line must be added?

Thx.
Nico80

Post by Nico80 »

No one knows exactly how to configure delegates.xml?
Post Reply