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
This commit is contained in:
Matthias Clasen 2009-03-01 07:39:03 +00:00
parent 1291ab4a18
commit d5a09342c4
2 changed files with 13 additions and 1 deletions

View File

@ -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 ===

View File

@ -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;