Postscript delegate failed

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
macmagick

Postscript delegate failed

Post by macmagick »

I am trying to convert EPS to PNG withing imagick. I have ImageMagick-6.4.9 and Ghostscript 8.64 on a Leopard Server 10.5.6. Everything is working im my shell, ie:

convert -verbose /img.eps /img.png

gives the output:
"gs" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -g232x153 "-sOutputFile=/var/tmp/magick-GsdUCTPJ" "-f/var/tmp/magick-Jc6bi0Zk" "-f/var/tmp/magick-0POBJfHJ"
/var/tmp/magick-GsdUCTPJ PNG 232x153 232x153+0+0 8-bit DirectClass 2.29kb
/img.eps PS 232x153 232x153+0+0 16-bit DirectClass 2.29kb
/img.eps=>/img.png PS 232x153 232x153+0+0 16-bit DirectClass 2.89kb

and the img.png is a perfect PNG.

Now I am trying to do the same with Imagick. Imagick has been installed through PECL and is working well as long as I convert between PNG, JPG and GIF.

Here's my PHP code:

$eps=new imagick();
$eps->readImageBlob($img);
$eps->setImageFormat("jpg");
header('Content-type: image/jpg');
echo($eps);

$img is pure Postscript generated with PHP (starting like %!PS-Adobe-2.0 EPSF-2.0...). But actually it doesn't matter if I first save the $img into a file img.eps or passing $img with readImageBlob. The error remains the same:

Fatal error: Uncaught exception 'ImagickException' with message 'Postscript delegate failed `/var/tmp/magick-VTc8KKgb': No such file or directory @ ps.c/ReadPSImage/742' ...

It seems like nothing beeing written into /var/tmp while using EPS-files with imagick?
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: Postscript delegate failed

Post by mkoppanen »

Is "gs" in the path for the webserver user?
Mikko Koppanen
My blog: http://valokuva.org
macmagick

Re: Postscript delegate failed

Post by macmagick »

Thank you for the tip! I tried the following:

changing within delegates: command=""gs" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pbmraw" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s""/>

to: command=""/usr/local/bin/gs" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pbmraw" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s""/>

helped!
Post Reply