manually set delegate path to gs (ghostscript)

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?".

manually set delegate path to gs (ghostscript)

Postby imarcw » 2009-07-13T10:29:54-07:00

I'm using IM to convert both PDFs and image files to JPEG. I have IM and ghostscript installed on Mac OS X using MacPorts and everything works fine in Terminal, with PDFs or otherwise.

I tried to call the convert command using AppleScript's "do shell script" command and "convert" wasn't recognized. Thanks to the following Apple developer note, I realized that AppleScript just needed the path to IM to be explicitly set, so instead of convert, I used /opt/local/bin/convert.

Problem partially solved. Now I'm finding that when using IM within AppleScript on PDFs, it has the same problem finding the gs command, only I don't know how to specify the path because I'm not calling gs directly.

This is just a shot in the dark, but I'm looking at /opt/local/lib/ImageMagick-6.5.4/config/delegates.xml and wondering if the following line (or another one like it) can be edited somehow to include the full path to gs:

<delegate decode="pdf" encode="eps" mode="bi" command="&quot;gs&quot; -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 &quot;-sDEVICE=epswrite&quot; &quot;-sOutputFile=%o&quot; &quot;-f%i&quot;"/>

If so, what is the exact language needed (I already know the path is /opt/local/bin/gs), and if not, what else can I do?

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

Re: manually set delegate path to gs (ghostscript)

Postby magick » 2009-07-13T10:36:26-07:00

You specify an absolute path. Find out where gs is located and substitute it in the delegates.mgk configuration file (i.e. &quot;/opt/local/bin/gs&quot;);


Re: manually set delegate path to gs (ghostscript)

Postby imarcw » 2009-07-13T10:50:54-07:00

That worked, just as I speculated it might. Thanks!


Re: manually set delegate path to gs (ghostscript)

Postby fantomas » 2010-05-14T22:51:37-07:00

I read above three messages about 10 times, my logic device gives up :)
So where can I set path to GS? Having no any delegates.mgk file.

UPD. Oh, I'm blind. Now see the BOLD "&quot;gs&quot;" in first message )


Re: manually set delegate path to gs (ghostscript)

Postby devnul » 2010-10-08T22:22:51-07:00

I was having a similar problem (though building ImageMagic from source code) and based on my reading of the configure shell script, this worked for me:

PSDelegate=/usr/local/ghostscript/bin/gs ./configure --prefix=/usr/local/ImageMagick-6.5.4-2 --with-frozenpaths

Hope this helps someone.

- dEvNuL

Return to “Users”

Who is online

Users browsing this forum: Bing [Bot], TurnitinBot [Bot] and 5 guests