Commit 083d9451 authored by Michael J. Chudobiak's avatar Michael J. Chudobiak Committed by Michael J. Chudobiak

Read RAW photos using dcraw only (without pfstools).

2007-02-10  Michael J. Chudobiak  <mjc@cvs.gnome.org>

        * README:
        * libgthumb/file-utils.c: (get_pixbuf_using_external_converter),
        (gth_pixbuf_animation_new_from_uri):
        Read RAW photos using dcraw only (without pfstools).

        * src/gth-exif-data-viewer.c: (update_file_info):
        Show mime type, including for hdr and raw images.


svn path=/trunk/; revision=1345
parent 283ebaf4
2007-02-10 Michael J. Chudobiak <mjc@cvs.gnome.org>
* README:
* libgthumb/file-utils.c: (get_pixbuf_using_external_converter),
(gth_pixbuf_animation_new_from_uri):
Read RAW photos using dcraw only (without pfstools).
* src/gth-exif-data-viewer.c: (update_file_info):
Show mime type, including for hdr and raw images.
2007-02-09 Paolo Bacchilega <paobac@cvs.gnome.org>
* src/gth-browser.c (_set_fullscreen_or_slideshow): do not use the
......
......@@ -103,8 +103,16 @@ Compiling
If the libiptc library version >= 0.2.1 is present you can store
comments in the IPTC metadata of a JPEG image.
If dcraw, pfstools, and pfstmo are installed, gthumb can view
RAW and HDR images. See http://www.mpi-inf.mpg.de/resources/pfstools.
If the libopenraw library version >= 0.0.2 is present you can view
RAW photo thumbnails.
If dcraw is present (and is in your executable search path),
gthumb can view full RAW photos.
If pfstools and pfstmo are installed, gthumb can view HDR images.
See http://www.mpi-inf.mpg.de/resources/pfstools.
To view OpenEXR files with pfstools, the OpenEXR libraries need
to be installed. See http://www.openexr.com/.
Download
========
......
......@@ -2412,7 +2412,7 @@ copy_cache_file_to_remote_uri (const char *local_filename,
/* Pixbuf + VFS */
static GdkPixbuf* convert_exotic_format_to_tiff (const char *path, const char *mime_type)
static GdkPixbuf* get_pixbuf_using_external_converter (const char *path, const char *mime_type)
{
char *cache_file;
char *md5_file;
......@@ -2421,12 +2421,21 @@ static GdkPixbuf* convert_exotic_format_to_tiff (const char *path, const char *m
char *input_file_esc;
char *command;
GdkPixbuf *pixbuf = NULL;
gboolean is_raw;
is_raw = mime_type_is_raw (mime_type);
md5_file = gnome_thumbnail_md5 (path);
input_file_esc = shell_escape (path);
cache_file_full = get_cache_full_path (md5_file, ".tiff");
if (is_raw)
/* pnm is dcraw's default output format */
cache_file_full = get_cache_full_path (md5_file, "conv.pnm");
else
/* what's best for pfstools? tiff or png? */
cache_file_full = get_cache_full_path (md5_file, "conv.tiff");
cache_file = g_strdup (remove_scheme_from_uri (cache_file_full));
cache_file_esc = shell_escape (cache_file);
......@@ -2441,13 +2450,15 @@ static GdkPixbuf* convert_exotic_format_to_tiff (const char *path, const char *m
/* Do nothing if an up-to-date converted file is already in the cache */
if (!path_is_file (cache_file) ||
(get_file_mtime (path) > get_file_mtime (cache_file))) {
if ( mime_type_is_raw (mime_type) ) {
command = g_strconcat ( "pfsindcraw ",
if ( is_raw ) {
/* raw files */
command = g_strconcat ( "dcraw -c ",
input_file_esc,
" | pfsclamp --rgb | pfstmo_drago03 | pfsout ",
" > ",
cache_file_esc,
NULL );
} else {
/* hdr files */
command = g_strconcat ( "pfsin ",
input_file_esc,
" | pfsclamp --rgb | pfstmo_drago03 | pfsout ",
......@@ -2590,12 +2601,12 @@ gth_pixbuf_animation_new_from_uri (const char *filename,
#endif
/* Use pfstools for raw images (non-thumbnails) and HDR images.
Use libopenraw in the future for raw images, because the API and
library requirements are much simpler. */
/* Use dcraw for raw images (non-thumbnails) and pfstools for HDR images.
Use libopenraw preferentially in the future for raw images, once
it matures. */
if ( (pixbuf == NULL) &&
(mime_type_is_raw (mime_type) || mime_type_is_hdr (mime_type)) )
pixbuf = convert_exotic_format_to_tiff (local_file, mime_type);
pixbuf = get_pixbuf_using_external_converter (local_file, mime_type);
/* All other file types, or if previous methods fail: read in a
......
......@@ -35,6 +35,8 @@
#include "gth-exif-utils.h"
#include "gth-exif-data-viewer.h"
#include "image-viewer.h"
#include "gconf-utils.h"
#include "preferences.h"
#include <libexif/exif-data.h>
#include <libexif/exif-content.h>
......@@ -768,6 +770,7 @@ update_file_info (GthExifDataViewer *edv)
double sec;
GnomeVFSFileSize file_size;
char *file_size_txt;
const char *mime_type;
if (edv->priv->viewer == NULL)
return;
......@@ -793,6 +796,8 @@ update_file_info (GthExifDataViewer *edv)
file_size = get_file_size (edv->priv->path);
file_size_txt = gnome_vfs_format_file_size_for_display (file_size);
mime_type = get_file_mime_type (edv->priv->path,
eel_gconf_get_boolean (PREF_FAST_FILE_TYPE, TRUE));
/**/
add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, _("Name"), utf8_name, -7);
......@@ -800,7 +805,7 @@ update_file_info (GthExifDataViewer *edv)
add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, _("Dimensions"), size_txt, -5);
add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, _("Size"), file_size_txt, -4);
add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, _("Modified"), utf8_time_txt, -3);
add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, _("Type"), gnome_vfs_mime_get_description (get_mime_type (edv->priv->path)), -2);
add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, _("Type"), mime_type, -2);
/**/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment