- Used to work under 5.x
- Upgraded Drupal from 5.x to 6.x
- Upgraded Image module
- Error message
If temp directory is ../tmp (means ~/tmp)

ImageMagick command: /usr/bin/convert -resize 100x75! -strip -quality 90 -density 72 -units PixelsPerInch '../tmp/DSCF0004_0.JPG' 'sites/default/files/images/temp/DSCF0004_0.thumbnail.JPG'
ImageMagick output:
ImageMagick reported an error: convert: unable to open image `../tmp/DSCF0004_0.JPG': No such file or directory. convert: missing an image filename `sites/default/files/images/temp/DSCF0004_0.thumbnail.JPG'.
Unable to create scaled Thumbnail image

If tmp directory is /tmp (means /tmp i.e. root)

ImageMagick command: /usr/bin/convert -resize 100x75! -strip -quality 90 -density 72 -units PixelsPerInch '/tmp/DSCF0004.JPG' 'sites/default/files/images/temp/DSCF0004.thumbnail.JPG'
ImageMagick output:
ImageMagick reported an error: convert: unable to open image `sites/default/files/images/temp/DSCF0004.thumbnail.JPG': No such file or directory.
Unable to create scaled Thumbnail image

If tmp directory is temp (means ~/public_html/temp)

ImageMagick command: /usr/bin/convert -resize 100x75! -strip -quality 90 -density 72 -units PixelsPerInch 'temp/DSCF0004.JPG' 'sites/default/files/images/temp/DSCF0004.thumbnail.JPG'
ImageMagick output:
ImageMagick reported an error: convert: unable to open image `temp/DSCF0004.JPG': No such file or directory. convert: missing an image filename `sites/default/files/images/temp/DSCF0004.thumbnail.JPG'.
Unable to create scaled Thumbnail image

Looks like to be some file ownership problems...?

Advice to solve the problem will be appreciated... : ) But preferably not to use /tmp as temp folder because it's a shared host...

Miscellaneous information:
- Normal file attachment works
- GD2 works
- Shared host
- File system:
* File system path: sites/default/files (means ~/public_html/sites/default/files)
* Temporary directory: See above
- ImageMagick Binary:

ImageMagick command: /usr/bin/convert -version
ImageMagick output: Version: ImageMagick 6.0.7 07/25/08 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2004 ImageMagick Studio LLC

Comments

Hetta’s picture

Have you copied (or moved) image.imagemagick.inc from /sites/all/image/ to /includes/ ?

loyukfai’s picture

Yes I did. : )

Any other suggestion...?

loyukfai’s picture

Not sure... But this maybe a duplicate or something similar to http://drupal.org/node/207359...?

Anyhow... I still don't know how to get it to work...

loyukfai’s picture

Category: bug » support
Status: Active » Postponed

Further information... It seems that it's a compatibility issue with FastCGI, when it's disabled, ImageMagick works fine...

Both the FastCGI and PHP5 processes run under my username. So I guess the problem is that, under FastCGI, the convert process runs under another username so it cannot access the files under my home folder.

I'm going to check with my host first.

Further information (just in case)...

Permissions of the "sites/default/files" folder:
drwxr-xr-x 5 username username 4096 Sep 18 12:45 files/

Permissions of the "sites/default/files/images" folder:
drwxr-xr-x 4 username username 4096 Sep 15 17:45 images/

Permissions of the "sites/default/files/images/temp" folder:
drwxrwxr-x 2 username username 4096 Sep 18 17:45 temp/

Permissions of the "../tmp" folder:
drwxr-xr-x 9 username username 4096 Sep 23 03:45 tmp/

Edit: Maybe it isn't an ownership issue afterall... Done some strace and found that during the ImageMagick process, the working directory under normal PHP5 is my public_html directory, while under FastCGI is /usr/local/cpanel/cgi-sys... Since the ImageMagick command is run using relative paths, so maybe that's why, under FastCGI, ImageMagick doesn't work...

Maybe it will work if I enter all paths under File System to be absolute paths but I don't want to do that...

loyukfai’s picture

Status: Postponed » Closed (fixed)

Update: My host told me that they couldn't change the FastCGI behaviour (that the working directory becomes "/usr/local/cpanel/cgi-sys" instead of "/home/username/public_html"), and use "normal" PHP5 instead.

Although it should be possible to 1) use an absolute path for the "files" directory in Drupal or, 2) hardcode the $cwd parameter in the proc_open command in image.imagemagick.inc, to make it works. Both of which don't seem to be nice and clean solutions to me. So I'm going to keep using "normal" PHP5 for now.

If you have a better idea, please do let me know! THX! : )