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):
Posts: 3236
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?
Posts: 19
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!!
Posts: 32509
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.
Posts: 19
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.
Posts: 19
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
Posts: 7994
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).
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.[/]
Posts: 19
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!
Posts: 7994
Hmm. Here's why it failed:
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...
Posts: 1
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
Posts: 32509
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.