GNOME integration of digital camera RAW format MINI HOWTO

demonstration image

I am using GNOME desktop for my daily work and I manage photos from my digital camera in Nautilus commander. There is MINI HOWTO for integrating RAW files to GNOME 2.4 and newer using tools from dcraw project.

With these files you will be able to see digital camera RAW file thumbnails in Nautilus and open images by clicking on them.

You can also change the file contents, and use this MINI HOWTO to add any new MIME-type to the system.

  1. Install any rawphoho plugin to the GIMP (file names mentioned below and names in files are valid for GIMP 2.2): either simple Dave Coffin's rawphoto plugin or nice Paweł Jochym's RawPhoto or Udi Fuchs' UFRaw or Joseph Heled's rawphoto (last two has some Nikon enhancements). For Minolta cameras you can use Mrwtoppm plugin, which is not based on dcraw.
  2. Define image/x-dcraw mime type. Copy dcraw.mime to /usr/share/mime-info. It defines this mime type for suffixes .bay, .bmq, .cr2, .crw, .cs1, .dc2, .dcr, .fff, .k25, .kdc, .mos, .mrw, .nef, .orf, .pef, .raf, .rdc, .srf and .x3f. If you have shared-mime-info-0.21 or newer, you can skip this step – raw MIME types are already defined (basic support was added in shared-mime-info-0.20).
  3. For the same purpose in GNOME 2.6 and later you need to define Shared MIME Info Database entry by copying dcraw.xml to /usr/share/mime/packages. Then you need to run update-mime-database /usr/share/mime. Note that GNOME 2.10 and share-mime-info-0.16 has MIME sub-class support, which is needed to open for opening RAW files embedded to JPEG or TIFF like Nikon NEF. This works correctly since gnome-vfs-2.10.2 (see GNOME bug 171595). For older versions you can want sub-class-less implementation of dcraw.xml.
  4. Define standard application for opening RAW files – GIMP by copying dcraw.keys to /usr/share/mime-info. Let me know more translations (in current GNOME not yet displayed). Note that gimp-2.2 is not executable name, but key name from /usr/share/application-registry/gimp.applications. For older GNOME applications, edit this file and add ,image/x-dcraw to the end of line with mime_types=. You should properly install (or link) these files from /usr/share/gimp/2.2/misc, if your distribution does not do it for you.
  5. For the same purpose in GNOME 2.8 and later you need to edit /usr/share/applications/gimp-2.2.desktop and add a string image/x-dcraw; to the end of the line beginning with MimeType=. For newer shared-mime-info, you have to add all related MIME types – GNOME does not yet support sub-class for thumbnailers. Then you need to call update-desktop-database.
  6. Copy default icon gnome-dcraw.png defined by keys file to /usr/share/pixmaps.
  7. For the same purpose in GNOME 2.8 and later you need to copy or link the icon to file gnome-mime-image-x-dcraw.* in directory /usr/share/icons/gnome/*/mimetypes, e. g. by ln -s /usr/share/pixmaps/gnome-dcraw.png /usr/share/icons/gnome/48x48/mimetypes/gnome-mime-image-x-dcraw.png (in newer GNOME versions, it is outdated – icons are smaller here, and also need to be added for all raw MIME types defined in shared-mime-info).
  8. Copy dcraw-thumbnailer somethere to your path. Note that this script requires preview included in RAW file, It uses dcraw and gnomevfs-copy. If your camera has small or no RAW preview, you can use alternative dcraw-thumbnailer, which uses original RAW data interpreted by dcraw. It is significantly slower, but can result much better results (thanks to Mattias Holmlund). Note that these thumbnailers don't work properly with gnome-vfs-2.10.0 and 2.10.1 (see GNOME bug 172658). If you are using dcraw in rcs revision < 1.310, you have to use old thumbnailers (dcraw-thumbnailer, alternative dcraw-thumbnailer) using parse from dcraw (this binary can have name dcparse or miss in your distribution, please verify and optionally edit the script).
  9. Let GNOME know about your new thumbnailer – copy dcraw.schemas to /etc/gconf/schemas and generate GConf database entries: GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-install-rule dcraw.schemas.
  10. Don't forget to set “Only smaller than” in your Nautilus preview preferences to proper file size.

Alternative installation to /usr/local directories: If you distribution sets environment variable GNOME2_PATH to proper value (e. g. /usr/local:/usr), it's also possible (except /usr/local/share/mime – there you need variable XDG_DATA_DIRS).

Note that those paths are valid only for GNOME in /usr prefix. It can vary on different distributions:

LICENSE: Files in this HOWTO are free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Source form of icon is available in XCF format.

PROBLEMS: RAW files can also have following suffixes: .jpg, .raw and .tif. It's impossible to detect RAW file from these suffixes, so it's required to detect them from contents. Owners of such cameras: Please send me a magic keys for those files. Mime file: Added most suffixes.

TODO: Small icon (needed for example for GTK file dialog), better thumbnailer, gdk-pixbuf loader, nautilus RAW EXIF reader. Any volunteers?

NEWS 2006-03-20: Info about new shared-mime-info and needed updates of gimp.desktop, thumbnailers for dcraw ≥ 1.310. Reference to distribution packages.

NEWS 2005-06-12: Typo fixes.

NEWS 2005-05-16: MIME sub-class support.

NEWS 2005-03-01: New definition of MIME type icon.

NEWS 2005-01-30: Use /tmp for temporary files.

NEWS 2005-01-29: Significantly improved thumbnailer: don't create temporary file for local files, work correctly for write-protected files, alternative thumbnailer. Updated known problems.

NEWS 2005-01-15: Inform more about programs and GIMP plugins, GNOME 2.8 support. Updated names for GIMP 2.2.

NEWS 2004-09-06: Fixed dcraw.keys (translation syntax).

NEWS 2004-09-02: Removed obsolete thumbnail scaling (nautilus does it). Thumbnailer is now much faster. GPL license.

NEWS 2004-08-25: Fixed bug in schemas file (bad enable key). Recognize more suffixes. Thumbnailer: Delete temporary directory. Icon. New sections Installation to /usr/local and Problems and html improvements.

NEWS 2004-05-04: Remove temporary files in dcraw-thumbnailer.

NEWS 2004-04-16: Initial version.

Notes and questions send to: Stanislav Brabec

Main page of Penguin's UTX WWW

Penguin server Valid XHTML 1.0! Valid CSS!