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$
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();
Any advice?