Commit 34c5fdfa authored by Michael J. Chudobiak's avatar Michael J. Chudobiak Committed by Michael J. Chudobiak

Added note about RAW and HDR viewing requirements.

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

        * README:
          Added note about RAW and HDR viewing requirements.

        * libgthumb/file-utils.c: (get_file_mime_type):
          Improved detection of HDR file types, when conventional mimetype
          detection fails or detects binary data.


svn path=/trunk/; revision=1342
parent fc09959f
2007-02-09 Michael J. Chudobiak <mjc@cvs.gnome.org>
* README:
Added note about RAW and HDR viewing requirements.
* libgthumb/file-utils.c: (get_file_mime_type):
Improved detection of HDR file types, when conventional mimetype
detection fails or detects binary data.
2007-02-08 Paolo Bacchilega <paobac@cvs.gnome.org>
* libgthumb/gth-image-list.c: use pos instead of selection_pending_pos
......
......@@ -103,6 +103,9 @@ 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.
Download
========
......@@ -116,4 +119,4 @@ Download
cvs -d:pserver:anonymous@anoncvs.gnome.org:/cvs/gnome co gthumb
11 October 2006
9 February 2007
......@@ -813,47 +813,51 @@ get_file_mime_type (const char *filename,
if (filename == NULL)
return NULL;
/* Check for HDR file types, which are not well represented in the
freedesktop mime database currently. This section can be purged
when they are. This is an unpleasant hack. Some file extensions
may be missing here; please file a bug if they are. */
const char *extension = get_filename_extension (filename);
if (extension != NULL) {
if ( !strcasecmp (extension, "exr")
|| !strcasecmp (extension, "hdr")
|| !strcasecmp (extension, "pic"))
return g_strdup ("image/x-hdr");
}
if (fast_file_type) {
char *sample_name;
char *n1;
sample_name = get_sample_name (filename);
if (sample_name == NULL)
return NULL;
if (sample_name != NULL) {
n1 = g_filename_to_utf8 (sample_name, -1, 0, 0, 0);
if (n1 != NULL) {
char *n2 = g_utf8_strdown (n1, -1);
char *n3 = g_filename_from_utf8 (n2, -1, 0, 0, 0);
if (n3 != NULL)
result = gnome_vfs_mime_type_from_name_or_default (file_name_from_path (n3), NULL);
g_free (n3);
g_free (n2);
g_free (n1);
}
n1 = g_filename_to_utf8 (sample_name, -1, 0, 0, 0);
if (n1 != NULL) {
char *n2 = g_utf8_strdown (n1, -1);
char *n3 = g_filename_from_utf8 (n2, -1, 0, 0, 0);
if (n3 != NULL)
result = gnome_vfs_mime_type_from_name_or_default (file_name_from_path (n3), NULL);
g_free (n3);
g_free (n2);
g_free (n1);
g_free (sample_name);
}
g_free (sample_name);
} else {
if (uri_scheme_is_file (filename))
filename = get_file_path_from_uri (filename);
result = gnome_vfs_get_file_mime_type (filename, NULL, FALSE);
}
/* If the file extension is not recognized, or the content is
determined to be binary data (octet-stream), check for HDR file
types, which are not well represented in the freedesktop mime
database currently. This section can be purged when they are.
This is an unpleasant hack. Some file extensions
may be missing here; please file a bug if they are. */
if ( (result==NULL) ||
!strcmp (result, "application/octet-stream")) {
const char *extension = get_filename_extension (filename);
if (extension != NULL) {
if ( !strcasecmp (extension, "exr") /* OpenEXR format */
|| !strcasecmp (extension, "hdr") /* Radiance rgbe */
|| !strcasecmp (extension, "pic")) /* Radiance rgbe */
return "image/x-hdr";
}
}
return result;
}
......
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