Thumbnail appears broken for any image upload in G2

viper99
viper99's picture

Joined: 2004-01-22
Posts: 19
Posted: Mon, 2005-03-21 00:46

I recently decided to setup and play around with G2 before migrating my
existing G1. I have successfully setup G2 (all steps). Then I have this
weird problem with the thumbnails.
Basically, I added sample images. They were added fine except that
thumbnails show up as broken. javascript:emoticon(':cry:')
javascript:emoticon(':cry:') Clicking on the broken thumbnail does load
the actual full image as you can see. I have ImageMagik and NetPBM both
graphics toolkits installed and setup the preference to use ImageMagick first. In siteadmin under ImageMagick and NetPBM both pass all the
tests successfully.
Best way to understand this is simply look at my sample site listed
in below url. Any help will be much appreciated. I have supplied all info below for faster troubleshooting. Thanks.
----

Gallery URL (optional): http://parikh.dhs.org/gallery2/
Gallery version: G2 Beta 1 (Dark Fiber) Nightly build 03/20/2005
Webserver (with version): Apache 2.0.52
Datatabase (with version): MySQL 4.1.7
PHP version (eg 4.2.1):4.3.9
phpinfo URL (optional):http://parikh.dhs.org/phpinfo.php
Graphics Toolkit(s): ImageMagick 6.0.7
Operating system: RedHat AS 4
Web browser/version: Firefox 1.1/ IE
G1 version (for migration bugs):

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Mon, 2005-03-21 01:20

It seems pretty obvious that your IM or NetPBM is not setup properly. Are you sure you actually downloaded the binaries? Or did you just activate the modules? What does the "Test" button reveal in these module settings?

 
viper99
viper99's picture

Joined: 2004-01-22
Posts: 19
Posted: Mon, 2005-03-21 01:54

I did not just activate modules. I have both IM and NetPBM binaries installed in
/usr/bin and path has been specified properly. All tests pass successfully. See below
output. It is worth noting here that the same server also hosts my production G1
which uses same version of IM and NetPBM just fine.

Anyway, following is the output that "Test Settings" button reveals:

ImageMagick binary test results
Binary Name Pass/Fail
identify Passed
convert Passed
composite Passed

Version
ImageMagick 6.0.7

Supported MIME Types
The ImageMagick module can support files with the following MIME types:

image/gif
image/jpeg
image/pjpeg
image/png
image/tiff
image/svg+xml
image/bmp
application/photoshop

Help! Anybody, please. Thanks!!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-03-21 09:46

In Site Admin -> ImageMagick/Netpbm: After testing, you have to press save and after that, you have to go to Site Admin -> Modules and activate (not just install) these modules.

try again.

If you have done so, let's deactivate Netpbm/GD for now so that imagemagick is the only image toolkit activated. and try again.

if it still fails, activate immediate debug output in config.php and see if that reveils anything.

 
viper99
viper99's picture

Joined: 2004-01-22
Posts: 19
Posted: Mon, 2005-03-21 17:50

Valiant,
I have indeed activated modules after installing. I also tried deactving others and
leaving only ImageMagick as per your suggestion, still no luck. I did upload file
again after doing to see if new file's thumbnail is created properly or not.

Finally, I also activated immediate debug and got something worth paying
attention. I was trying to upload a image file named "school_of_rock.jpg".
Now see the debug log below:

fopen(/var/www/g2data/cache/module/imagemagick/0/0/0.inc, rb, 0) fread(Resource id #165, 4096) fclose(Resource id #165) tempnam(/var/www/g2data/tmp/, imgk_) getcwd() chdir(/var/www/g2data/tmp/) Executing: ( "/usr/bin/convert" "-quality" "90" "-size" "100x100" "-geometry" "100x100" "-strip" "/var/www/g2data/albums/School_of_Rock.jpg" "/var/www/g2data/tmp/imgk_yUaujN" ) 2>/var/www/g2data/tmp/g2dbgrnJUHS file_exists(/var/www/g2data/tmp/g2dbgrnJUHS) filesize(/var/www/g2data/tmp/g2dbgrnJUHS) fopen(/var/www/g2data/tmp/g2dbgrnJUHS, r, 0) feof(Resource id #167) fgets(Resource id #167, 4096) feof(Resource id #167) fgets(Resource id #167, 4096) feof(Resource id #167) fgets(Resource id #167, 4096) feof(Resource id #167) fclose(Resource id #167) unlink(/var/www/g2data/tmp/g2dbgrnJUHS) Regular Output: Error Output: convert: unable to open image `/var/www/g2data/albums/School_of_Rock.jpg': Permission denied. convert: missing an image filename `/var/www/g2data/tmp/imgk_yUaujN'. Status: 1 (expected 0) unlink(/var/www/g2data/tmp/imgk_yUaujN) chdir(/var/www/html/gallery2) copy(/var/www/html/gallery2/modules/core/classes/../data/broken-image.gif, /var/www/g2data/cache/derivative/0/5/59.dat) filesize(/var/www/g2data/cache/derivative/0/5/59.dat)

As you can see above that ImageMagick was not able to read the file "school_of_rock.jpg" due to permission denied. So, next I checked the permissions
in /var/www/g2data/albums directory and file was listed with 600 permission
although I have setup in General section of SiteAdmin to use 644 as file and 755
for directory permissions and my g2data directory has 777 permissions.

See below all the permissions setup on g2data directory/subdirectories.

[root@parikh www]# ls -ld g2data/
drwxrwxrwx 9 apache apache 4096 Mar 20 14:17 g2data/
[root@parikh www]# cd g2data
[root@parikh g2data]# ls -l
total 64
drwxr-xr-x 2 apache apache 4096 Mar 21 12:34 albums
drwxr-xr-x 6 apache apache 4096 Mar 20 14:38 cache
drwxr-xr-x 12 apache apache 4096 Mar 20 13:38 locks
drwxr-xr-x 2 apache apache 4096 Mar 21 12:03 sessions
drwxr-xr-x 3 apache apache 4096 Mar 20 13:38 smarty
drwxr-xr-x 2 apache apache 4096 Mar 20 14:29 thumbnail
drwxr-xr-x 2 apache apache 4096 Mar 21 12:23 tmp
-rw-r--r-- 1 apache apache 17 Mar 20 14:15 versions.dat
[root@parikh g2data]# cd albums
[root@parikh albums]# ls -l
total 1732
-rw------- 1 apache apache 886604 Mar 20 19:07 DSC00912.jpg
-rw------- 1 apache apache 867109 Mar 20 19:07 DSC00913.jpg
-rw------- 1 apache apache 124193 Mar 21 12:23 School_of_Rock.jpg

Funny thing is that its just the thumbnail that shows up broken, clicking on it does
load the actual image, so apparently apache can read it as you can see from
above permissions that apache has permission to read it. I don't know why its
being set to 600 although I have set it to use 644 in General/SiteAdmin section.

So question is that is ImageMagick being run ander apache user in G2? If so, then
it should be able to read the permissions and file as apache is able to. And if not,
then why G2 sets the permission of 600 after file upload eventhough I select it
to be 666 in General/SiteAdmin section? I don't know if anybody else is having
these issues. Any help would be much appreciated. Thanks.

 
viper99
viper99's picture

Joined: 2004-01-22
Posts: 19
Posted: Mon, 2005-03-21 19:43

OK, so just to summarize the problem so far:

After Image upload using any method, thumbnails show up broken (failed to
create thumbs during upload) but full images do show up fine. All permissions
of g2data directory and sub-directories seem fine. see my previous reply. Images
do make it to g2data/albums directory after upload with permissions 600 eventhough I set to 644 or even 664 in General/SiteAdmin section. However, corresponding thumbs in g2data/thumbnail/ directory do not appear. That is why I guess thumbs appear broken. I have tried all suggestions and played around for more than a day now without any luck so far!
Any help will be appreciated. Thanks a lot.

You can see the problem visually by going to my site:
http://parikh.dhs.org/gallery2/main.php

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2005-03-22 10:25

Something is going wrong when we try to create the thumbnails. Here're the steps to debug it. As a side note, we don't put thumbnails into the g2data/thumbnail directory (that's for the thumbnail module; which is a little different).

  1. Right click a thumbnail, get the url and open it in a new browser window so that all you can see is the broken thumbnail image.
  2. Edit your config.php and set G2 into "logged" debug mode. Provide it with a path to a log file. Make sure that this works (reload G2, then check the file to make sure it has data in it). When you're done testing to make sure it works, clean out the file so that it's ready for our test.
  3. Delete g2data/cache/derivative/*
  4. Reload the thumbnail in your browser. Remember you want to load only the thumbnail
  5. Turn off debug mode (or else that file will get huge!)

Now you should have a logfile containing all the debug output from building the image. In that logfile should be the commands we executed to try to generate the thumbnail, as well as the errors that it encountered. Post a link to that log here and we'll check it out.[/]

 
viper99
viper99's picture

Joined: 2004-01-22
Posts: 19
Posted: Tue, 2005-03-22 15:35

Hello Bharat,
Thank you for this info. I have followed exactly the suggested steps above and
generated debug.log file which contains only the debug output of reloading only
the broken thumbnail in a new window. Link to this debug log is:

http://parikh.dhs.org/gallery2/debug.log

Right now gallery is off of the debug mode as you suggested. Thanks again!

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2005-03-23 04:49

Hmm. Here's why it failed:

2005-03-22 10:29:47 [3e9d1b2973054212593673fb730b387d] Error Output:
2005-03-22 10:29:47 [3e9d1b2973054212593673fb730b387d] convert: unable to open image `/var/www/g2data/albums/DSC00912.jpg': Permission denied.
2005-03-22 10:29:47 [3e9d1b2973054212593673fb730b387d] convert: missing an image filename `/var/www/g2data/tmp/imgk_pD6blz'.

Looks like more of your permission issues. I'm not sure what's going on here, but it's pretty clear that it's a permissions issue. As a test, how about you do a "chmod -R 777 g2data" so that the permissions issue goes away? If that fixes it, then you'll need to talk to your system administrator to figure out what the permissions and ownership should be. It's odd that Apache will let you create files that it can't read so something deeper is going on here...

 
Moondog

Joined: 2006-01-30
Posts: 1
Posted: Mon, 2006-01-30 07:00

I'm having a similar problem to that in this thread.

I am unable to generate thumbnails for images I upload via "Add Items/From Web Browser".
Thumbnail generation fails with the error "convert: unable to open image filename.jpg : Permission denied."
It also fails when I try from "System Maintenance" with the same error.
I tried the suggested "chmod -R 777 g2data", but that failed too.

However, when I upload imaged via "Add Items/From Local Server" all goes well.
Of course this is from a different directory with symbolic links, so I'm not
sure its relevant

Is there an update on this problem or anything else I can try?

Thanks,

Jon

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2006-01-31 10:58

could you please post:
FAQ: What information is required when I ask for help in the forums?

and please check tell us what filesystem permissions the file in g2data/albums/ has that you just added via add items -> from web page.