The problem is similiar to others reported, but I've decided to put it on separate thread, because I've done some tests which says something strange...
Here's a detailed explanation of the problem:
Drupal was uploaded as a zip via file manager and uncompressed online, so all dirs/files was owned by apache (in my case: owner 81, group 81). On my request, server admin changed owner/group to 1002 (me) / 81 (apache)
Access rights are now set to 02770 (dirs) and 0770 (files).
Drupal file management is set to public.
Clean URLs enabled.
Path to sites/default/files is accesible. I even gave imagecache_sample.png 0775 rights.
Imagemagick (version 6.5.2-7) is installed on server and activated at ImageAPI and Image Toolkit pages. Path to 'convert' is correct.
If I enter Imagecache (admin/build/imagecache) and choose any of the presets, I cannot see converted image (imagecache_sample.png). And if I enter 'configure', I receive the following error:
ImageMagick reported an error: convert: unable to open image `sites/default/files/imagecache_sample.png': No such file or directory @ blob.c/OpenBlob/2489. convert: unable to open file `sites/default/files/imagecache_sample.png' @ png.c/ReadPNGImage/2865. convert: missing an image filename `sites/default/files/imagecache/node-gallery-cover/imagecache_sample.png' @ convert.c/ConvertImageCommand/2776.
Sounds familiar, huh?..
Similiar errors happen when I try to create ANY preset manually (unable to open image, no such file or directory).
BUT:
Executing ImageMagick 'convert' from "one-line" php file works:
echo exec("/usr/bin/convert 'sites/default/files/imagecache_sample.png' -resize 100x114! -crop 100x100+0+7! -quality '75' 'sites/default/files/imagecache/node-gallery-thumbnail/imagecache_sample.png'");
converted file was written successfuly to above directory.
And now the resume:
Facts are:
------------------
- Directories/file exist and are accessible.
- Imagemagick works and is able to convert file as a standalone, WITHOUT Drupal
- Imagemagick doesn't work when its called from Drupal
Questions are:
------------------
- How should I understand those ImageMagick errors? Is Imagemagick reports this error also when it cannot write to temporary directory, or only when it cannot access source file?
- Why Imagemagick is able to find and open file when called from separate php command, and cannot do it from Drupal?
ps:
I've read really many threads, e.g today this: http://drupal.org/node/360193, but even after upgrading to imageapi-6.x-1.x-dev (May 30th version), nothing changed - error still exists. As to the http://drupal.org/node/224913 - I don't want change file management to private; it have to be public.
(However, I still suppose problem can be related to directories/permissions/server configuration, and is caused by one of the modules related to imagecache module.)
==========================
server/drupal details
==========================
PHP Version 5.2.10-pl0-gentoo
drupal core 6.13
cck 6.x-2.4
cck emailfield 6.x-1.2
cck embedded media field 6.x-1.2
cck imagefield 6.x-3.1
admin menu 6.x-3.0-alpha1
ajax 6.x-1.14
image 6.x-1.0-alpha5
imageapi 6.x-1.x-dev (2009-may-30)
imagecache 6.x-2.0-beta9
imce 6.x-1.2
imce_wysiwyg 6.x-1.0
languageicons 6.x-2.x-dev (2009-march-10)
lightbox2 6.x-1.9
masquerade 6.x-1.1
node_gallery 6.x-2.0-alpha10
switchtheme 6.x-1.1
thickbox 6.x-1.4
transliteration 6.x-3.x-dev (2009-jul-07)
views 6.x-3.x-dev (2009-jul-02)
webform 6.x-3.x-dev (2009-jul-09)
wysiwyg 6.x-2.0
Comments
Comment #1
afear CreditAttribution: afear commentedWe are having the same problem and have found a workaround that works for us. The problem seems to be related to the most recent version of the imageapi module. We reverted back to the older version of the module, and that fixed the problem. If there's a better way for us to handle this, or some other fix, please let us know.
Comment #2
afear CreditAttribution: afear commentedComment #3
cyc CreditAttribution: cyc commented@afear:
which imageapi version you use?
Comment #4
d3p CreditAttribution: d3p commentedI too had this kind of problem using Imagemagick. I solved switching the ImageAPI module to development snapshot 6.x-1.x-dev ( 2009-May-30 ).
d3p
Comment #5
cangeceiro CreditAttribution: cangeceiro commentedI also had the same issue and the dev branch of imageapi fixed the issue
Comment #6
chowdah CreditAttribution: chowdah commentedI had the same issue as well and installed the ImageAPI dev version of May 2009 [6.x-1.x-dev] and it fixed it as well. Seems to be that Image Magick breaks ImageCache using the latest stable release of imageAPI.
Comment #7
warchild CreditAttribution: warchild commentedI have the same error and I am unable to resolve it.
the things I find different are that I do not have the following two modules installed:
imageapi 6.x-1.x-dev (2009-may-30)
imagecache 6.x-2.0-beta9
but I do have :
image 6.x-1.0-alpha5
Comment #8
marzmurphy CreditAttribution: marzmurphy commentedhi,
sorry am not here with a solition :( but just trying to muddle through forums to basically sove this issue
ImageMagick reported an error: convert: unable to open image `composite': No such file or directory"
(or to which ever command im using). Does this mean that the the full imagemagick libary is not available and do you have to alter the files, or how the command line tools work in Drupal(using im_raw module). Im trying to remove the background of uploaded images, and think I may be foolish to think it will work out easy with the image module and image magick libary.......
Does anyone know of any tutorials to link these up!?!?
Hopefuly some one can help me/point me in the right direction...thanks:)
Comment #9
tehwalrus CreditAttribution: tehwalrus commentedI am also having this issue with v6.x-1.6 ...
Will try switching to the dev channel to resolve. working in MAMP on a mac.
(Drupal seems to be able to see the binary as the version string works when I configure the location of convert.
It only fails when I try and create a custom preset).
Comment #10
tehwalrus CreditAttribution: tehwalrus commentedOK, this works for me with V 6.x-1.5 ...
since we are having an issue with Drupal not being able to see the files, but the binary working fine, could it be related to:
#360193 by drimsun: Set ImageMagick's working directory to the server root.
which was added in the 1.6 release? my Drupal install is certainly not in the docroot, is this the case for anyone else? how do we alert drimsun to get them to take a look for us and try to repro?
Comment #11
mattwmc CreditAttribution: mattwmc commentedNot working for me either.
I'm using: imageapi-6.x-1.6
I'll try the dev.
**Edited: the dev worked, cool!
Comment #12
graytech CreditAttribution: graytech commentedI just ran into the same problem here using imageapi-6.x-1.6
Replaced it with imageapi-6.x-1.x-dev
and it works like a charm!
Thank everyone!
Comment #13
osu_bucks CreditAttribution: osu_bucks commentedHmmm.... I'm using this on ubuntu 2.6.18.8 with Drupal 6.14 + latest ubercart and encounter the above issue.
It doesn't happen when I use Imageapi 6.x-1.5, but it's failing with 6.x-1.6 and 6.x-1.x-dev (2009-Nov-29). Did it fix "Set ImageMagick's working directory to the server root", but break something else?
Comment #14
borfast CreditAttribution: borfast commentedI just ran into the same problem.
Latest version of everything as of this date (ImageAPI 6.x-1.6, ImageCache 6.x-2.0-beta10, Drupal 6.15)
Shouldn't this bug be ssigned to ImageAPI instead of ImageCache?
Comment #15
auris CreditAttribution: auris commentedI had the same problem. I installed ImageAPI 6.x-1.x-dev (2009-Nov-29) and the problem gone.
ImageCache version: 6.x-2.0-beta10
Comment #16
ludde_t CreditAttribution: ludde_t commentedSame problem here. But upgrading to the dev version DOES NOT solve it :-(
Comment #17
gwsavage CreditAttribution: gwsavage commenteddrupal directory must be document root directory in some cases will cause this error.
Comment #18
meisterhans CreditAttribution: meisterhans commentedthanks! I had the same problem. Solved it with moving to root directory.
Comment #19
afear CreditAttribution: afear commentedVersions of ImageAPI after 6.x-1.3 break Imagemagick if Drupal is in a subdirectory of the web server document root. Ankur submitted a patch that fixes the issue:
http://drupal.org/node/615966#comment-2578376
Comment #20
fizk CreditAttribution: fizk commentedPlease reopen if this is still an issue with ImageCache 6.x-2.0-rc1.