ImageMagick reported an error: convert: unable to open image `files/images/snacks n drinks_0.thumbnail.jpg': Permission denied.

a.k.karthikeyan - October 27, 2009 - 15:49
Project:Image
Version:6.x-1.0-beta3
Component:imagemagick toolkit
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Hello

I had recently upgraded my site from 5.20 to 6.14 and also upgraded to the latest image module . I used GD library initially but I got:-

# Unable to create scaled Thumbnail image.

when I go to the image gallery.

After that I changed the toolkit to Imagemagick

I am now getting the following error :-

"ImageMagick reported an error: convert: unable to open image `files/images/snacks n drinks_0.thumbnail.jpg': Permission denied.

Unable to create scaled Thumbnail image"

Can anybody help me ?

Thanks
Karthikeyan

#1

topologicc - October 29, 2009 - 07:41

Is your files/images directory read/writable to all? you should run this command: chmod -R 777 images when you are in the files directory.

#2

davideads - November 9, 2009 - 05:48
Category:support request» bug report

Topologic, you have to do no such thing, and setting your permissions that way could be a big fat security hole under certain configurations. What you should do is ensure that the user that the web server runs under (on my Debian machine Apache runs under 'www-data', other systems use 'httpd', 'apache', etc) has read/write permissions on all files in the 'files' directory and read/write/execute permissions on the 'files' directory and all its subdirectories.

I'm pretty sure this is a bug in the module. I ran into this tonight, and wrote a little patch which fixes it on my server by using absolute paths when invoking the 'convert' binary.

I'm using ImageMagick 6.3.7 on Debian Lenny.

AttachmentSize
imageapi_imagemagick_absolutepath.patch 1.06 KB

#3

joachim - November 10, 2009 - 18:20
Status:active» needs review

I don't use image magick so not in a position to test this patch.

Setting to needs review so others can test.

#4

topologicc - November 17, 2009 - 06:14

@davideads

Yeah, I violated one of the cardinal rules of permissioning. I run under a jailed shell in my shared web space, so I don't worry about it, but it is something that one shouldn't do.

In any event, your patch was applied correctly and I'm currently playing around with it to see if it fully works.

System specs:
Centos 5.4
ImageMagick 6.2.8 04/17/08

Since I am a moderate point release behind, I'm not sure if this poses any problems.

Thanks,
Chris

 
 

Drupal is a registered trademark of Dries Buytaert.