Unable to open image `/tmp/magick-XXXXX.ppm'

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
weshysell

Unable to open image `/tmp/magick-XXXXX.ppm'

Post by weshysell »

Ok, I'm officially stumped. I generally don't sign up for forums and ask questions, but this one has me beat. I've tried searching this site for this issue and I have had no luck. Please help or direct me to a thread that provides the answer I am looking for.

I am receiving this ImagickException from Imagick::__construct($file):
ImagickException: unable to open image `/tmp/magick-XX4OWwRd.ppm': No such file or directory @ blob.c/OpenBlob/2480
I am attempting to open either a CR2 or a DNG, both of which return the same error. I was, however, able to use the Imagick::readImageFile($handle) method to read the file, but I am now curious as to what I am missing on the difference between these two methods. I would prefer using the constructor, as I assume I am probably given much more capabilities with the images, considering the Imagick::readImageFile($handle) method is only producing me with the JPEG thumbnail that is embedded in these images, and the JPEG Image embedded within DNG files seems to max out at 256px which is too small for my purposes.

A co-worker of mine decided to attempt the same goal in Qt using Magick++ and MinGW, and eventually came to the same exact error.

Please help, as I cannot seem to find any other place that has any knowledge of this issue.

Server: Ubuntu 10.04 LTS
PHP Version: 5.x
Imagick::getVersion(): Array ( [versionNumber] => 1623 [versionString] => ImageMagick 6.5.7-8 2010-12-02 Q16 http://www.imagemagick.org )
Last edited by weshysell on 2010-12-19T22:52:00-07:00, edited 1 time in total.
weshysell

Re: Unable to open image `/tmp/magick-XXXXX.ppm'

Post by weshysell »

here's the PHP code I am using to read the file that is only providing me with, what I assume is, the Medium-Sized Thumbnail (maximum size seems to be 256x256).

Code: Select all

header("Content-Type: image/jpeg");
$h= fopen('test3.dng', 'r');
$img = new Imagick();
$img->readImageFile($h);
$img->setImageFormat("JPEG");
echo $img->getImage();         // or just: echo $img
The code that provides me with the ImagickException listed above is the same except for lines 1-3

Code: Select all

header("Content-Type: image/jpeg");
$img = new Imagick('test3.dng'); // This line throws ImagickException: unable to open image `/tmp/magick-XX4OWwRd.ppm': No such file or directory @ blob.c/OpenBlob/2480
...
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Unable to open image `/tmp/magick-XXXXX.ppm'

Post by magick »

ImageMagick relies on external delegate programs and libraries to read or write certain image formats. The DNG format requires the ufraw-batch program which may not be installed on your system. To verify, type
  • convert -list delegate | grep dng
Post Reply