Hi,
I verified that all components are working just fine separetely (Dcraw works, gallery "sees" it), but when I upload raw file I get not jpeg thumnail /no resized pic.
Debug Report:
Here is the debug output with the error. First line is the command it executes, notice the [0] at the end of the file name. I don't think that should be there. At the end it prints the error, Unable to open file. I'm not sure if it's supposed to be calling this convert command in the first place (seems like dcraw should come before it), but it's not calling it right so I can't be sure.
Quote:
2005-10-10 05:20:23 [190fd4d67820ff5fe84b776cb275927b] Executing: ( "/usr/bin/convert" "-quality" "80" "/home/www/danielphoto/gallery/g2data/albums/events/bm2005/test15.NEF[0]" "jpeg:/home/www/danielphoto/gallery/g2data/tmp/imgk_1Z8Y1j" ) 2>/home/www/danielphoto/gallery/g2data/tmp/g2dbgDmQfCu
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] getParameter exec.expectedStatus for core plugin
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] file_exists(/home/www/danielphoto/gallery/g2data/tmp/g2dbgDmQfCu)
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] filesize(/home/www/danielphoto/gallery/g2data/tmp/g2dbgDmQfCu)
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] fopen(/home/www/danielphoto/gallery/g2data/tmp/g2dbgDmQfCu, r, 0)
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] feof(Resource id #437)
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] fgets(Resource id #437, 4096)
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] feof(Resource id #437)
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] fgets(Resource id #437, 4096)
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] feof(Resource id #437)
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] fgets(Resource id #437, 4096)
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] feof(Resource id #437)
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] fclose(Resource id #437)
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] unlink(/home/www/danielphoto/gallery/g2data/tmp/g2dbgDmQfCu)
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] Regular Output:
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] Error Output:
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] convert: Unable to open file (/home/www/danielphoto/gallery/g2data/albums/events/bm2005/test15.NEF[0]) [No such file or directory].
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] convert: Missing an image file name.
2005-10-10 05:20:24 [190fd4d67820ff5fe84b776cb275927b] Status: 154 (expected 0)
Here is the Stack Trace below the error
Quote:
Error (ERROR_TOOLKIT_FAILURE)<b>in</b> modules/imagemagick/classes/ImageMagickToolkit.class <b>at line</b> 622 (gallerystatus::error)
<b>in</b> modules/imagemagick/classes/ImageMagickToolkit.class <b>at line</b> 369 (imagemagicktoolkit::_transformimage)
<b>in</b> modules/core/classes/GalleryDerivative.class <b>at line</b> 484 (imagemagicktoolkit::performoperation)
<b>in</b> modules/core/classes/GalleryDerivative.class <b>at line</b> 313 (galleryderivativeimage::_rebuildcache)
<b>in</b> modules/core/classes/GalleryDerivativeImage.class <b>at line</b> 175 (galleryderivative::rebuildcache)
<b>in</b> modules/core/classes/helpers/GalleryDerivativeHelper_advanced.class <b>at line</b> 703 (galleryderivativeimage::rebuildcache)
<b>in</b> modules/core/classes/GalleryCoreApi.class <b>at line</b> 843 (galleryderivativehelper_advanced::rebuildcache)
<b>in</b> modules/core/classes/helpers/GalleryDerivativeHelper_simple.class <b>at line</b> 66 (gallerycoreapi::rebuildderivativecache)
<b>in</b> modules/core/classes/GalleryCoreApi.class <b>at line</b> 830 (galleryderivativehelper_simple::rebuildcacheifnotcurrent)
<b>in</b> modules/core/classes/helpers/GalleryDerivativeHelper_advanced.class <b>at line</b> 681 (gallerycoreapi::rebuildderivativecacheifnotcurrent)
<b>in</b> modules/core/classes/GalleryCoreApi.class <b>at line</b> 843 (galleryderivativehelper_advanced::rebuildcache)
<b>in</b> modules/core/classes/helpers/GalleryDerivativeHelper_simple.class <b>at line</b> 66 (gallerycoreapi::rebuildderivativecache)
<b>in</b> modules/core/classes/GalleryCoreApi.class <b>at line</b> 830 (galleryderivativehelper_simple::rebuildcacheifnotcurrent)
<b>in</b> modules/core/CreateThumbnailOption.inc <b>at line</b> 76 (gallerycoreapi::rebuildderivativecacheifnotcurrent)
<b>in</b> modules/core/ItemAdd.inc <b>at line</b> 151 (createthumbnailoption::handlerequestafteradd)
<b>in</b> main.php <b>at line</b> 188 (itemaddcontroller::handlerequest)
<b>in</b> main.php <b>at line</b> 87
<b>in</b> main.php <b>at line</b> 80
Gallery version = 2.0 core 1.0.0
PHP version = 4.3.11 apache
Webserver = Apache/1.3.33 (Unix) PHP/4.3.11 FrontPage/5.0.2.2510
Database = mysqlt 3.23.58
Toolkits = ArchiveUpload, Gd, Dcraw, Thumbnail, ImageMagick, NetPBM, Exif
Operating system = Linux danielphoto.propagation.net 2.4.31 #2 SMP Mon Jun 6 08:53:40 CDT 2005 i686
Browser = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.50
Posts: 32509
/usr/bin/convert" "-quality" "80" "/home/www/danielphoto/gallery/g2data/albums/events/bm2005/test15.NEF[0]" "jpeg:/home/www/danielphoto/gallery/g2data/tmp/imgk_1Z8Y1j" )
is a little weird.
what's the filename you uploaded? what extension does it have?
imo it should first create a webviewable (jpg) derivative with dcraw and then use convert.
besides, have you tried using dcraw in the command line with the image you uploaded?
Posts: 83
filename is "test15.NEF" 'NEF' is Nikon d70raw format, dcraw supports it. I believe i saw a post few month ago that someone had successfully processed 'nef' files with G2.
Here is a link to download test file
dcraw in the command line processed the file and created 'ppm' (maybe i am wrong)
Posts: 7985
The [0] in the argument to convert tells it to use the first "scene" in a "multi-scene" image. In short, if the image is composed of multiple sub-images (like an animated gif) it forces us to take only the first one.
But if you're seeing this, then it means that something has gone wrong elsewhere. Imagemagick shouldn't be getting called upon to operate directly on this image; dcraw should be involved first to convert the .nef file to a JPEG. My guess is that something is misconfigured (or there's a bug) which causes ImageMagick to supercede dcraw in this case. Let's figure out what.
I'd start by going to your Site Admin -> Mime Types page and checking to make sure that "nef" is a registered mime type for image/x-dcraw. If that's the case, then I'd enable buffered debug mode and add just this one image and capture the entire debug output. You're looking for a line like this:
Note that dcraw is operating on the original image. After that, ImageMagick should only be operating on the result from dcraw since dcraw is going to convert it into a JPEG. If you don't see that (and I'm pretty sure you won't) then please post a link to your entire debug output so that we can pick through it and see what's up.
Posts: 83
Thanks for the reply. I agree that this is probably what's going on. But how do I make sure dcraw is called first? It seems to be calling ImageMagick "convert" and bailing after the error. Here is a link to the full log (very long) for uploading just the one NEF file:
http://danielphoto.com/bug.log
dcraw never gets executed...
Posts: 7985
Did you verify the mime types? (see my last post).
Posts: 83
Yes, "nef" is listed under image/x-dcraw. Should "visible" be checked for the mime type or not?
Posts: 32509
no, it should not be checked. that's fine.
i've tested your file with my g2 and it worked of course.
what's the history of your G2?
what was the original version, what upgrades did you make etc?
Posts: 83
original version was alpha and then upgraded every 2-3 weeks. all 'upgrades' (send as postcard, dynamic dropdown navigation, possibility to sell stock/print images) are in the separate module.. no mods to any of gallery's files.
I have few other domains on the same server. I will try to do a clean install and will post results..
thanks
Posts: 32509
c4actbe
clean install? but just in parallel, right? i don't think a clean install is necessary.
Posts: 83
yeah, a parallel. here is my failed attempt...
all 4 pics are the same file. First one was uploaded with Imagemagick, GD amd dcraw modules activated and configured. Debug tree shows "mimeType image/x-dcraw"
Second image was uploaded right after i tried to activate NetPBM, which failed to get activated because it it didn't find jhead. (debug tree: mimeType image/tiff )
3rd image was uploaded with imagemagick deactivated.(debug tree: mimeType image/tiff )
4th one - with GD off. (debug tree: mimeType image/tiff )
My second test was in uploading bpm,png24 tiff, ,psd, and photoshop raw file...
last 3 failed ..
Posts: 32509
please activate all toolkits and dcraw, then query your database.
select * from g2_TkOperatnMimeTypeMap;
and post here the results.
thanks.
Posts: 83
Here's the output. I apologize for the formatting, it's copied from an HTML table.
Posts: 83
Valiant? do you have any idea?
Posts: 32509
nope, no idea. plus bharat said he'd cover this issue (and he's very busy).
i assume your G2 file integrity is ok.
http://codex.gallery2.org/index.php/Gallery2:faq#How_can_I_make_sure_that_my_installation_files_are_all_intact.3F
Posts: 7985
Sorry I haven't been responding. I'm not sure what's going wrong here, but whatever it is it's not obvious. Is there any chance that I could ssh to your box and look at the code/database directly? That would probably let me resolve this pretty quickly. Private message me with the details if that's acceptable. Thanks!
Posts: 7985
Thanks for giving me access! I've fixed the problem. It turns out that this image was marked as an "image/tiff" in the database. Is it possible that you added it *before* enabling the dcraw module? My guess is that you did, and G2 didn't realize that it was a raw image. I changed the mime type and fixed the derivative (in the database) and it started working. Alternatively, you could have deleted and re-added the image and it would have worked. I added a couple of more copies of the image to the same album to verify that it works. I'm not sure how we could prevent this from happening in the future -- once an image is miscategorized it's a little tricky. Perhaps we should add the capability for overriding the mime type via the web interface?
Posts: 32509
and / or add the option to recategorize existing images, e.g. as an admin task.
e.g. when you add ffmpeg to your g2, you'll want to get the type and dimensions of all existing movies in your g2.
Posts: 83
Bharat, thank you very much for looking at the site... but this problem still exists...
No it was added after
G2 on this server still doesn't recognize NEF images as RAW and interpets them as TIFF. I tried to upload 3 files and all of them "failed". First 2 were uploaded using web worm, 3rd - using applet.
Thanks!
Posts: 32509
bharat wrote:
c4actbe wrote:
what now? did you both upload to the same G2 (since you have now 2 parallel G2s on this server)?
Posts: 83
yes we did. the same folder, which has failed images, contains processed NEF files. I never succeeded when tried to process raw files.
Posts: 7985
Sorry to take so long to get back to you. I think I have an idea what's going on here. When I did the upload, I uploaded the images from /home/www/danielphoto/temp_pictures where I put a copy of test15.NEF and totallynewname.NEF -- and both of those worked. I just logged on again and uploaded them.
How are you doing the upload. Are you uploading from your browser? And if so, what operating system is your browser running on? I'm wondering if your browser is telling Gallery that the file is an image/tiff .. if it tells us the mime type we believe it, and it could be misleading us. If that's the problem then I think we may have to introduce a way to allow you to override the browser's suggestion.
Posts: 83
You are correct. I uploaded the same file from my win xp sp2 machine using 3 browsers:
Opera 8.5: failure
IE: failure
Firefox: processed correctly ( thumbnail wasn't created, but it might be a separate issue).
Thanks for helping me out to narrow this issue.
I tried to submit bug to sourceforge, but i am not sure if it went through: i attached a test file, but after upload i got "Invalid file type" screen, Back button just cleared everything i wrote...
Posts: 32509
@sourceforge:
you see your bug listed immediately afterwards at the top, if it worked. given the error you received, it didn't work i guess.
maybe zip the nef file if you want to attach it.