GNOME Bugzilla – Bug 344598
import photos ignores RAW format images
Last modified: 2007-01-29 17:53:36 UTC
It would be nice if gthumb's import feature (gnome-volume-manager-gthumb) would also import images captures in RAW (NEF) format. In my case, using a Nikon D50, only jpg images on the camera are imported. This forces me to goto the shell and type "gphoto2 -P" to download the RAW images.
Thanks for the bug report. This particular request-for-enhancement has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of 145564 ***
Sorry, this is pretty old, but I guess the bug 145564 broadly covers the issue, I don't really need gthumb to view raw images, but just to see they are there and import them. If 145564 really covers this, then fine, but I just wanted to be sure. thanks!
OK, that's a little bit different. It might be a whole lot easier to add the import of raw photos (as opposed to viewing them). gThumb imports AVIs, even though it can't view them, so I'm not sure why it doesn't import raw photos... maybe it could be added as an option. Not sure yet... - Mike
dlg-photo-importer.c:valid_mime_type is used to check if the file is an image, a video or a audio file.
Some thoughts - Right now: 1) gthumb gets a list of all camera files in load_images_preview. 2) load_images_preview__step calls gp_camera_file_get with the GP_FILE_TYPE_PREVIEW parameter to get a list of thumbnails from the camera. 3) The user can then select some or none of these thumbnails. If none are selected, all will be add to the import list. 4) gthumb then cycles through the import list with gp_camera_file_get with the GP_FILE_TYPE_NORMAL parameter to download the full image files. (To download RAW images, you need to use the GP_FILE_TYPE_RAW parameter instead. And for audio, you would need GP_FILE_TYPE_AUDIO). I'm not sure about this, but I don't think the GP_FILE_TYPE_PREVIEW step reports previews of RAW files, so we probably need to do this: A) Modify load_images_preview__step so that if PREVIEW fails, try RAW or AUDIO modes, using generic icons in the displayed file list. B) Modify save_image so that if NORMAL fails, try RAW or AUDIO modes. Does anyone see flaws in this? I haven't used RAW files before, so I could be missing the obvious... - Mike
Let me modify that, because it's a silly method. We probably need to: A) Modify load_images_preview__step to check the file type as reported by gp_camera_file_get_info. (Save the file type in a list, to avoid duplication in the next step?) Treat PREVIEW files as we currently do, but add cases to handle RAW and AUDIO files, using generic icons for them in the displayed thumbnails. B) Modify save_image to check the file type as reported by gp_camera_file_get_info (or refer to the saved type list?). Download all files in the list, using the correct type parameter as reported by gp_camera_file_get_info. That doesn't seem so difficult... - Mike
Just to be sure I understand the difference, this bug is concerned with getting the RAW image files from the camera onto the computer (importing them) and bug 145564 is concerned with being able to view the images contained in the RAW files after they've been imported. Is that correct? Assuming I've got that right, I'd like to suggest that all RAW formats are supported, not just Nikon's NEF. I use Canon and Fuji cameras, for example. Each variety of files has its own filename extension. You can find sample images files for many RAW formats here: http://www.glasslantern.com/RAWpository/
Yes, this bug is about importing only. The raw import feature as currently outlined would support whatever libgphoto2 recognizes as a raw photo file. - Mike
Note to self: valid_mime_type has to be changed too, or it will filter out RAW files. - Mike
I'm not sure that it is possible to determine the file type (RAW, PREVIEW, AUDIO) before using the gp_camera_file_get function on the file. That is, you have to download the file to know the type! So perhaps the error-based switching of comment 5 is better. - Mike
After all my theorizing here, I tested a camera with RAW photo support... and gthumb imports it just fine! (Minolta MRW files). So... what's the actual problem here? Does MRW work, but NEF doesn't? I need some clearer reports of what works and what doesn't. It you have a raw format that doesn't import, please let me know what version of libgphoto2 you have installed (and the gthumb version) - Mike
Sample files (which don't import correctly) would be helpful. - Mike
John, Is image/x-nikon-nef registered as a mime type on your system? (It is on mine). - Mike
How does one check registered mime types?
Checking the properties on a .NEF file pulled using "gphoto -P", I see: Type: TIFF image MIME type: image/tiff However, gphoto -L shows: There is no file in folder '/'. There is 1 file in folder '/special'. #1 curve.ntc There is no file in folder '/store_00010001'. There is no file in folder '/store_00010001/DCIM'. There is no file in folder '/store_00010001/DCIM/100NCD50'. There is 1 file in folder '/store_00010001/DCIM/101NCD50'. #2 DSC_5646.NEF 5463 KB application/x-unknown Also, sample images will be ~5.3megs, are you sure you want that?
John, Running: grep -r nef /usr/share/mime*/ on my system returns a bunch of references to "image/x-nikon-nef". I'm not sure what the "official" way of listing registered mimetypes is. There must be a command for that... anybody know? Please attach a sample nef image here (assuming it will let you), or somewhere where I can download it. I will copy it to a flash card, and see if gthumb can import it using the libgphoto2 mass storage driver. - Mike
$ grep -ir nef /usr/share/mime* /usr/share/mime/packages/gnome-raw-thumbnailer.xml: <glob pattern="*.nef" /> /usr/share/mime/packages/gnome-raw-thumbnailer.xml: <glob pattern="*.NEF" /> /usr/share/mime/globs:image/x-dcraw:*.nef /usr/share/mime/globs:image/x-dcraw:*.NEF /usr/share/mimelnk/image/x-raw.desktop:Patterns=*.raw;*.RAW;*.dcr;*.DCR;*.dng;*.DNG;*.crw;*.CRW;*.cr2;*.CR2;*.nef;*.NEF;*.mrw;*.MRW;*.bay;*.bmq;*.cs1;*.dc2;*.erf;*.fff;*.hrd;*.k25;*.kdc;*.mdc;*.mos;*.orf;*.pef;*.pxn;*.raf;*.rdc;*.sr2;*.srf;*.x3f; /usr/share/mimelnk/image/x-xcf-gimp.desktop:Comment[ven]=Tshivhumbeo tsha tshifanyiso tsha henefho tsha GIMP (Snipped the clearly incorrect hits). Unfortunately the NEF file won't attach (too large). Send me email and I'll privately reply w/ a link to a sample image.
John, email me at mjc@avtechpulse.com. (I don't think I have your email address.) - Mike
John, I copied your NEF image onto a flash card which also had some JPG and MRW images. gThumb imported them all just fine (using a card reader). gThumb even displays your NEF image as a 160x120 TIFF image. (It's still a 5.3 MB file, so there is obviously more data there, but it is displaying something at least. gqview shows the same thing.) Do you have a flash card reader? Maybe try importing through the flash card reader instead of through the camera - the libgphoto2 camera driver might have a bug. Maybe that's why the file is reported as "application/x-unknown" by gphoto2 -L... This isn't really looking like a gthumb issue... - Mike
True, putting the camera in mass-storage mode and re-running gnome-volume-manager-gthumb appeared to work as I'd expect. So it does look to be a gphoto issue. I'll continue looking to see how to get gphoto's mime type to do the right thing.
John, Is it OK if I make your image (DSC_5646.NEF) publicly available as a sample image for test purposes? There seems to be a shortage of publicly available test photos in RAW formats. - Mike