I have searched the forums high and low. Found lots of problems similar to mine, but none exactly matching.

I recently transfered one of my sites to a new hosting provider. All is finally up and running except ImageMagick.

Notes:

  • PHP Safe mode is off
  • open_basedir set to no value
  • Changed permissions of files/images and files/images/temp to 777 to eliminate directory permisisons issues
  • using GD Library, all works fine.
  • When i switch to ImageMagick toolkit, photo uploads don't work.
  • ImageMagick is installed, convert.exe is detected, confirmation message as follows

# ImageMagick command: /usr/bin/convert -version
# ImageMagick output: Version: ImageMagick 6.2.8 03/14/07 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC

however, when i upload an image .. via upload image, acidfree photo, etc, i get an error when using imagemagick:

# ImageMagick reported an error: convert: unable to open image `files/images/temp/DSCF0006_3.JPG': No such file or directory. convert: missing an image filename `files/images/temp/DSCF0006_3.JPG'.
# ImageMagick reported an error: convert: unable to open image `files/images/temp/DSCF0006_3.JPG': No such file or directory. convert: missing an image filename `files/images/temp/DSCF0006_3.thumbnail.JPG'.
# Unable to create scaled Thumbnail image

# ImageMagick reported an error: convert: unable to open image `files/images/DSCF0006_3.JPG': No such file or directory. convert: missing an image filename `files/images/DSCF0006_3.thumbnail.JPG'.
# Unable to create scaled Thumbnail image

# ImageMagick reported an error: convert: unable to open image `files/images/DSCF0006_3.JPG': No such file or directory. convert: missing an image filename `files/images/DSCF0006_3.thumbnail.JPG'.
# Unable to create scaled Thumbnail image

# ImageMagick reported an error: convert: unable to open image `files/images/DSCF0006_3.JPG': No such file or directory. convert: missing an image filename `files/images/DSCF0006_3.thumbnail.JPG'.
# Unable to create scaled Thumbnail image

I've given in to just using GD Library for now, but would love to get this working. Any help is appreciated.

Thanks

Comments

okellhammer’s picture

I have the same problem since upgrading to drupal 5.7. I used to be able to make it go away by installing the image_enhanced_scaling module but that isn't recommended for Drupal 5.7. I wish I could figure this out.

I can upload and scale images in IMCE though, but only save them as a page, not as an image.

Looking forward to a fix on this one !

sanvi’s picture

I've the same problem. I've drupal 6. I'm looking any solutions since many weeks.

ImageMagick reported an error: convert: unable to open image `tmp/foto0414.jpg': No such file or directory. convert: missing an image filename `sites/default/files/images/temp/foto0414.thumbnail.jpg'.
Unable to create scaled Thumbnail image
El archivo /home/coitipa seleccionado no se pudo copiar.

thanks,

Mercedes

DannyPfeiffer’s picture

for me it turned out to be a permissions issue. the image module wants to use the default tmp file on the server ... which is outside of the document root.

I hacked image.module to point to a temp folder i created inside of /files ... with the correct permissions set and it works.

Danny Pfeiffer
http://RehabCreative.com

DannyPfeiffer’s picture

the other solution is to just use GD library.

Danny Pfeiffer
http://RehabCreative.com

imkatie1’s picture

Could you tell me how you hack the image module specifically?

Thank you in advance.

jamesczar’s picture

I have made sure the path settings all corresponded. I looked inside the image.module and that was pointing to the right place. But I've still got the same issue:

ImageMagick reported an error: convert: unable to open image `sites/default/files/images/temp/Picture 1.png': No such file or directory. convert: missing an image filename `sites/default/files/images/temp/Picture 1.thumbnail.png'.

Thing is, the upload is happening. The file is getting to sites/default/files/images/temp/ but ImageMagick can't do anything with the file once it's out there.

GD2 works fine.

(and I'm sure the path to the ImageMagick convert binary is correct because ImageMagick is responding with version info while in the debug mode).

So what else could this be? (btw, I'm on D6.9, Image 6.x-1.0-alpha4, ImageMagick 6.0.7 07/25/08 Q16)

unxde’s picture

I got the same issue on Drupal 6.10, image upload was ok, but imagemagick said "no such file.."

In my case, the problem was that the imagemagick script was launched with working dir == DocumentRoot of the webserver, but my site was placed in /drupal directory.

I made a small patch that appends $base_dir to the fourth ("cwd") proc_open argument:

--- imageapi_imagemagick.module	2009-04-24 16:03:26.000000000 +0700
+++ imageapi_imagemagick.module.new	2009-04-24 16:04:38.000000000 +0700
@@ -191,7 +191,8 @@ function _imageapi_imagemagick_convert_e
     1 => array('pipe', 'w'), // stdout
     2 => array('pipe', 'w')  // stderr
   );
-  if ($h = proc_open($convert_path .' '. $command_args, $descriptors, $pipes, $_SERVER['DOCUMENT_ROOT'])) {
+  global $base_url;
+  if ($h = proc_open($convert_path .' '. $command_args, $descriptors, $pipes, $_SERVER['DOCUMENT_ROOT'].$base_url)) {
     $output = '';
     while (!feof($pipes[1])) {
       $output .= fgets($pipes[1]);

..worked fine for me ;-)

It's not the best way to fix the problem, so I'm waiting for a better one :-)

masood_mj’s picture

Thanks it worked for me drupal 6.10 with imageapt 6.x-1.6

drewish’s picture

http://drupal.org/node/360193 is the best issue to discuss this change on.

warchild’s picture

Windows 7 has nothing to do with this issue.

I am having this now as well, but permissions look good and so does my temp directory path.

its just not making the thumbnail image.

* ImageMagick command: /usr/local/bin/convert -resize 250x255! -strip -quality 75 -density 72 -units PixelsPerInch 'sites/ish.com.au/files/images/temp/taggingSubjects_4.JPG' 'sites/ish.com.au/files/images/temp/taggingSubjects_4.thumbnail.JPG'
* ImageMagick output:
* Image taggingSubjects has been updated.

* ImageMagick reported an error: convert: unable to open image `sites/ish.com.au/files/images/temp/taggingSubjects_4.JPG': No such file or directory @ blob.c/OpenBlob/2489. convert: missing an image filename `sites/ish.com.au/files/images/temp/taggingSubjects_4.thumbnail.JPG' @ convert.c/ConvertImageCommand/2772.
* Unable to create scaled Thumbnail image.
* The selected file /usr/local/www/drupal6 could not be copied.

if I run that ImageMagick command on the command line it works fine.

curtgadget’s picture

Man, I wasted two days of my life trying to figure this one out. I had the same problem where my site was placed in a sub directory under my document root. So appending the folder to the path worked for me.

Thanks!

graytech’s picture

Thank you sooo much! I have been beating my head against the wall on this one all evening. I should have checked the forums first. I was starting to realize it was a path problem by the error it was kicking out and your patch proved it. A fix to this problems really needs to be included in the next update to ImageAPI. ImageMagic is so much more versatile than GD and using it definitely helps with performance when it is working. Thanks again.

~Gray~

graytech’s picture

This is exactly what I have needed as well. Does anyone know if a patch similar to this one will be included in the next update of imageapi? It would be nice.

peroski’s picture

Thanks unxde!

leoklein’s picture

I'm happy to say I was lucky to find this a bit more quickly than curtgadget.

Thanks for this help.