diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2009-03-01 07:39:03 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2009-03-01 07:39:03 +0000 |
commit | d5a09342c4fa8759a64374e4b01fd7a7e491fb90 (patch) | |
tree | 5ad9c507349cb972535b01c8687ffa4b9b3a3307 /gdk-pixbuf | |
parent | 1291ab4a18da4f522abc1e219867fbf2cd69f83e (diff) | |
download | gtk+-d5a09342c4fa8759a64374e4b01fd7a7e491fb90.tar.gz |
If pure sniffing yields uncertain results, try again with the filename.
* gdk-pixbuf-io.c (_gdk_pixbuf_get_module): If pure sniffing
yields uncertain results, try again with the filename.
Patch by Tyler Lawson
svn path=/trunk/; revision=22433
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/ChangeLog | 9 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-io.c | 5 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 385577a4ad..d16222dbcb 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,12 @@ +2009-03-01 Matthias Clasen <mclasen@redhat.com> + + Bug 569671 – gdk_pixbuf_new_from_file() can't open + image/x-portable-pixmap + + * gdk-pixbuf-io.c (_gdk_pixbuf_get_module): If pure sniffing + yields uncertain results, try again with the filename. + Patch by Tyler Lawson + 2009-02-17 Matthias Clasen <mclasen@redhat.com> * === Released 2.15.4 === diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index b1b9be24bd..abb920359e 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -793,8 +793,11 @@ _gdk_pixbuf_get_module (guchar *buffer, guint size, gchar **mimes; gchar *type; gint j; + gboolean uncertain; - mime_type = g_content_type_guess (NULL, buffer, size, NULL); + mime_type = g_content_type_guess (NULL, buffer, size, &uncertain); + if (uncertain) + mime_type = g_content_type_guess (filename, buffer, size, NULL); for (modules = get_file_formats (); modules; modules = g_slist_next (modules)) { GdkPixbufModule *module = (GdkPixbufModule *)modules->data; |