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?".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: manually set delegate path to gs (ghostscript)

Post by fmw42 »

If you want to run a unix shell script from Applescript, then use "do script" and not "do shell script". The latter will not use your PATH and so will not find convert. If you want to use do shell script, then you must provide the full path to convert.

Code: Select all

tell application "Terminal"
	do script "yourscript"
end tell
or

Code: Select all

do shell script "export PATH=/usr/local/bin:$PATH; path2/yourscript"
The former will open the terminal app and run the script, so you will see any progress or errors.

The latter will run in the background and you will not see any progress or errors as far as I have experiences. I use the former.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: manually set delegate path to gs (ghostscript)

Post by fmw42 »

I assume you edit your delegates.xml file

<delegate decode="pdf" encode="eps" mode="bi" command=""absolutepath2/gs" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=epswrite" "-sOutputFile=%o" "-f%i""/>
AusS2000
Posts: 32
Joined: 2012-03-16T22:12:53-07:00
Authentication code: 8675308

Re: manually set delegate path to gs (ghostscript)

Post by AusS2000 »

Yes, I tried making the path to gs in delegates.xml absolute.
AusS2000
Posts: 32
Joined: 2012-03-16T22:12:53-07:00
Authentication code: 8675308

Re: manually set delegate path to gs (ghostscript)

Post by AusS2000 »

I mucked around with permissions on the gs file (actually gs-noX11 as that is the target on the symbolic link 'gs').

It was initially:
root xxx
wheel xxx
everyone xox

I first tried changing 'everyone' to xxx (no joy) then:
wayneirvine xxx
admin xxx
everyone xxx

Still no joy.
AusS2000
Posts: 32
Joined: 2012-03-16T22:12:53-07:00
Authentication code: 8675308

Re: manually set delegate path to gs (ghostscript)

Post by AusS2000 »

I'd try running gs directly but not sure how much of this is required:

"/usr/local/bin/gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dFirstPage=1 -dLastPage=1 "-sOutputFile=/var/tmp/magick-9241lGGLX0O8AQ74%d" "-f/var/tmp/magick-9241EScvRp4x3xp8" "-f/var/tmp/magick-9241P8JBWLadebba"' (-1)

or how to structure the input and output strings.
AusS2000
Posts: 32
Joined: 2012-03-16T22:12:53-07:00
Authentication code: 8675308

Re: manually set delegate path to gs (ghostscript)

Post by AusS2000 »

Hmm, tried:
gs -dNOPAUSE -sDEVICE=jpeg -r144 -sOutputFile=/Library/Server/Web/Data/Sites/~bartel/brochures/images/EV-RD-6770-3291.jpg /Library/Server/Web/Data/Sites/~bartel/brochures/files/EV-RD-6770-3291.pdf

From the command line and of course it works. Very confusing
AusS2000
Posts: 32
Joined: 2012-03-16T22:12:53-07:00
Authentication code: 8675308

Re: manually set delegate path to gs (ghostscript)

Post by AusS2000 »

And bypassing imagemagick and calling gs directly from the script also works.

I realise I can get away with calling gs to go from PDF to JPG and then call imagemagick to resize but I would really like to solve the problem of calling gs from within imagemagick.
AusS2000
Posts: 32
Joined: 2012-03-16T22:12:53-07:00
Authentication code: 8675308

Re: manually set delegate path to gs (ghostscript)

Post by AusS2000 »

Seems this has moved quite a bit off-topic. I'll move my issue to another thread to save any further confusion.
AusS2000
Posts: 32
Joined: 2012-03-16T22:12:53-07:00
Authentication code: 8675308

Re: manually set delegate path to gs (ghostscript)

Post by AusS2000 »

Post Reply