Postscript delegate failed
Posted: 2009-02-18T01:38:18-07:00
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?
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?