user error: ImageMagick reported an error: in /[PATH TO ROOT]/sites/default/modules/imageapi/imageapi_imagemagick.module on line 224.

I upgraded my image api module recently and am sporadically getting these error messages after creating a post that uses imagefield to upload and imagecache to create derivative images. I replaced the path to my actual drupal root with [PATH TO ROOT] above.
If I read line 224 correctly, this is a error that throws when Imagemagick returns a something besides a 0 - but there is little other info I can glean from this. Where do I look for more info to fix this 'error' - if it is one?

BTW I'm using Drupal 6.17

Comments

paul@poetsma.nl’s picture

I'm having the same issue. The output of the debug option is

ImageMagick command: /usr/bin/convert -version
ImageMagick output: Version: ImageMagick 6.2.8 04/17/08 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC 
srobert72’s picture

Subscribing.
Same error for me.

develCuy’s picture

subscribing :(

develCuy’s picture

Wrong checking for return code of imagemagick, patch attached.

paul@poetsma.nl’s picture

Thanks, I have applied the patch and the message is gone.

develCuy’s picture

Status: Active » Reviewed & tested by the community
parasox’s picture

After upgrading ImageAPI to the latest Jul 11th dev I had to re-apply this patch as I was getting this error again, and the patch worked.

So I'm assuming this patch never made it to the new dev codebase or whatever. Just thought I'd mention it.

klonos’s picture

Patch in #4 still applies and fixes the issue in latest 6.x-1.x-dev (2010-Jul-11).

... come on people, this is RTBC for almost 2 months now! Please get it in at least in a dev version.

drewish’s picture

Status: Reviewed & tested by the community » Fixed
klonos’s picture

Thanx Andrew! Good to have you back ;)

drewish’s picture

you're welcome, trying to clear things up. really need to dig into the imagecache queue :(

klonos’s picture

I'll see if I can spare some of my almost-non-existent free time (got an extra day-job now) to help you there. ...you know, I can do things link ping some people about old issues and test some of them against latest stable version + dev to see if they still stand.

chowdah’s picture

Seems my errors are gone since upgrading! Thanks!

drupalhorn’s picture

Hello,

I get a similar error:

user error: ImageMagick reported error code 9. in ../sites/all/modules/imageapi/imageapi_imagemagick.module on line 227.

This is what I did to provoke the error:

1. new content type with CCK image field
2. new page of this content type with uploaded image file

I see that the image file is actually uploaded and viewable on the website as it should, so why the error? I have 755 permission set on my files folder on the server.

Another issue that I have is that if I want to make drupal save the image files in a subfolder named after the content type in the files folder using filefield path, it tends to create a folder named [type] instead of the actual name of the content type .... hmmmm? I believe the syntax is correct for path setting for the image field. Could it be related to the above error?

I am using

Drupal core 6.19
Content Construction Kit (CCK) 6.x-2.8
FileField 6.x-3.7
FileField Paths 6.x-1.4
Image 6.x-1.0
ImageAPI 6.x-1.9
ImageCache 6.x-2.0-beta10
ImageField 6.x-3.7

christelle41’s picture

Hello,
I have the same error except the error code is -1.
I have the last dev version of imageapi...
Thanks a lot for your help !

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

klonos’s picture

Status: Closed (fixed) » Active

I bet this is far from fixed yet ;)

...if the bot closes it again (due to inactivity) I'll just set it to postponed.

drewish’s picture

Status: Active » Closed (fixed)

klonos, please read #9 and don't re-open this unless you can clearly explain how this is still a problem.

klonos’s picture

Sorry about that Andrew, I keep quite a few test setups around where I am able to reproduce certain issues so I can help with the issue queues. I was still getting this in the setup I was maintaining for this specific issue here, but I just noticed that it was rolled back to a previous backup somehow. My bad.

drewish’s picture

No worries. Thanks for the testing.

duntuk’s picture

same error for me too, except the on line 227

user error: ImageMagick reported error code 1 ... user error: ImageMagick reported error code 1 imageapi_imagemagick.module on line 227

I think it has to do something with allocated memory in a shared hosting environment... I wasn't getting this on a dedicated server, but on a shared server (with low amount of memory allocation) I was getting intermittent error from imagecache, then noticed this error in ImageAPI...

safani’s picture

Version: 6.x-1.x-dev » 6.x-1.9
Status: Closed (fixed) » Active

I am getting this error as well

user error: ImageMagick reported error code 1. in /xxxxx/sites/all/modules/imageapi-6.x-1.9/imageapi/imageapi_imagemagick.module on line 227.

erald’s picture

Having the same error
drupal ImageMagick reported error code 1. in /var/www/html/mysite/sites/all/modules/imageapi/imageapi_imagemagick.module on line 227.

Randomly appears and a complete fresh install with the latest versions.

Rok Žlender’s picture

Same problem here

user error: ImageMagick reported error code 1. in /var/aegir/drupal-6.20/sites/www.example.com/modules/imageapi/imageapi_imagemagick.module on line 227.

For some reason imagemagick is returning status code 1 for simple version check

~$ convert -version
Version: ImageMagick 6.4.5 2009-06-04 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

~$ echo $?
1
Rok Žlender’s picture

I only found this comment that might explain what is going on http://omeka.org/forums/topic/installation-on-mac-os-x-1055#post-1133 it seems that imagemagick returns status code 1 when running without any arguments which version checking is. I'm attaching a patch that handles it not sure tough if this is the way to go.

Rok Žlender’s picture

Rerolled patch with my correct git details hope I did it right this time.

Rok Žlender’s picture

Status: Active » Needs review
Magnus’s picture

Title: Generic Error message from imageapi_imagemagick.module on line 224 » Generic Error message from imageapi_imagemagick.module on line 227
Category: support » bug
Status: Needs review » Reviewed & tested by the community

The patch in #26 fixes the issue.

drewish’s picture

FileSize
868 bytes

Make a small change to the structure for clarity.

drewish’s picture

Status: Reviewed & tested by the community » Fixed

committed to 6.x-1.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

geoffb’s picture

I have updated to ImageCache 6.x-2.0-beta12 and am still getting user error:

ImageMagick reported error code 9. in /[PATH TO ROOT]/sites/all/modules/contrib/imageapi/imageapi_imagemagick.module on line 236.

ImageCache 6.x-2.0-beta12 is dated 2011-May-16 and am wondering if it included the patch detailed above.

Also wondering if the patch dealt with error code 9 (or just error code 1).

Other info:
Drupal core 6.22
Content Construction Kit (CCK) 6.x-2.9
FileField 6.x-3.10
ImageAPI 6.x-1.10
ImageCache 6.x-2.0-beta12
ImageCache Actions 6.x-1.8
ImageField 6.x-3.10
ImageField Focus 6.x-1.3

marcoBauli’s picture

Version: 6.x-1.9 » 6.x-1.10
Status: Closed (fixed) » Active

Same error with Imagecache 2.x-rc1, except that error code is 11 instead of 1 or 9.

ImageMagick reported error code 11. in /[path]/sites/all/modules/imageapi/imageapi_imagemagick.module on line 231.

EDIT: debugging info from Imagemagic

ImageMagick command: /usr/bin/convert 'sites/default/files/userspics/picture-489.jpg' -resize 220x220! -crop 220x165+0+27! -unsharp 0.5x0.5+1+0.05 -quality '80' 'sites/default/files/imagecache/preview/userspics/picture-489.jpg'
ImageMagick output:

Version: ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP http://www.imagemagick.org

marcoBauli’s picture

Update: the culprit seems to be the Crop action combined with Sharpen.

Using Scale + Sharpen does work, but any combination of Scale and Crop + Sharpen, or Scale + Crop + Sharpen leads to the error.

Setting Crop as the last action (Scale + Sharpen + Crop) does work though.

Thanks

alexx90’s picture

I'm having this error message
user error: ImageMagick reported error code -1. in /home/myweb/ht_docs/drupal/sites/all/modules/imageapi/imageapi_imagemagick.module on line 227.

I'm using a web hosting