More correct content type handling

svn path=/trunk/; revision=20897
This commit is contained in:
Matthias Clasen
2008-07-23 04:20:15 +00:00
parent 7551360c1e
commit 830a9d2710
4 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2008-07-23 Matthias Clasen <mclasen@redhat.com>
* gdk-pixbuf-io.c (_gdk_pixbuf_get_module): Compare two content
types, not content type and mime type.
2008-07-21 Matthias Clasen <mclasen@redhat.com>
* === Released 2.13.5 ===

View File

@ -770,6 +770,7 @@ _gdk_pixbuf_get_module (guchar *buffer, guint size,
#ifdef GDK_PIXBUF_USE_GIO_MIME
gchar *mime_type;
gchar **mimes;
gchar *type;
gint j;
mime_type = g_content_type_guess (filename, buffer, size, NULL);
@ -783,10 +784,13 @@ _gdk_pixbuf_get_module (guchar *buffer, guint size,
mimes = info->mime_types;
for (j = 0; mimes[j] != NULL; j++) {
if (g_ascii_strcasecmp (mimes[j], mime_type) == 0) {
type = g_content_type_from_mime_type (mimes[j]);
if (g_ascii_strcasecmp (type, mime_type) == 0) {
g_free (type);
selected = module;
break;
}
g_free (type);
}
}
g_free (mime_type);