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
youds
Posts: 53
Joined: 2010-01-28T05:38:11-07:00
Authentication code: 8675309

Postscript delegate failed

Post by youds »

Hi

I'm having problems with ImageMagick / iMagick using Zend Server Community Edition Version 4.0.6 (PHP 5.3 on Mac OS X 10.6)

From phpinfo():
- imagick module version 2.2.2
- ImageMagick 6.3.7
- ImageMagick Number of supported formats: 165

From CLI:

Code: Select all

craig-fairhursts-computer:Desktop youdsmedia$ gs -v
GPL Ghostscript 8.70 (2009-07-31)
Copyright (C) 2009 Artifex Software, Inc.  All rights reserved.
craig-fairhursts-computer:Desktop youdsmedia$ convert -version
Version: ImageMagick 6.5.9-0 2010-01-27 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP OpenCL 

craig-fairhursts-computer:Desktop youdsmedia$ convert 396677.pdf image.jpg
craig-fairhursts-computer:Desktop youdsmedia$ ls /usr/local/zend/apache2/bin/
ab		apxs		envvars-std	htdigest	logresolve
apachectl	checkgid	gs		htpasswd	rotatelogs
apr-1-config	dbmmanage	htcacheclean	httpd
apu-1-config	envvars		htdbm		httxt2dbm
craig-fairhursts-computer:Desktop youdsmedia$
With the above setup, I get this error:
Fatal error: Uncaught exception 'ImagickException' with message 'Postscript delegate failed `/Users/youdsmedia/Sites/panaz/1.0.4a/admin/tmp/newpdf2.pdf': No such file or directory' in /Users/youdsmedia/Sites/panaz/1.0.4a/admin/includes/common/fpdi/pdf.php:54 Stack trace: #0 /Users/youdsmedia/Sites/panaz/1.0.4a/admin/includes/common/fpdi/pdf.php(54): Imagick->__construct('../../../tmp/ne...') #1 {main} thrown in /Users/youdsmedia/Sites/panaz/1.0.4a/admin/includes/common/fpdi/pdf.php on line 54

Here's the code:

Code: Select all

$im = new Imagick('newpdf2.pdf' ); 

$im->setImageColorspace(255);
$im->setCompression(Imagick::COMPRESSION_JPEG);
$im->setCompressionQuality(100);
$im->setImageFormat('jpeg');
// Output the image
$output = $im->getimageblob();
$outputtype = $im->getFormat();

header("Content-type: $outputtype");
echo $output;
$im->clear();
$im->destroy();
I've searched all over the place for a solution. I had the same problem from command line when GhostScript wasn't installed, but from PHP it doesn't appear to know where or how to call GhostScript even though installed on CLI. As you can see from above, I've copied over the "gs" script into the apache2 bin so the script is present, and should be in Apache's Environment path. However the error says "GhostScript not installed" to me.

Any advice?
ImageMagick 6.5.9-1
GhostScript 8.7
libpng-1.2.43RC1
iMagick 3.0.0RC1
youds
Posts: 53
Joined: 2010-01-28T05:38:11-07:00
Authentication code: 8675309

Re: Postscript delegate failed

Post by youds »

I found out that the .so I was using was the incorrect version.
Ended up giving up on Zend Server, as the compiled extensions were for old versions. I switched to CentOS with a DirectAdmin installation run locally.
ImageMagick 6.5.9-1
GhostScript 8.7
libpng-1.2.43RC1
iMagick 3.0.0RC1
Post Reply