From 830a9d27109c68e0c40c3caa5fed94304fef1358 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 23 Jul 2008 04:20:15 +0000 Subject: [PATCH] More correct content type handling svn path=/trunk/; revision=20897 --- ChangeLog | 5 +++++ configure.in | 4 +++- gdk-pixbuf/ChangeLog | 5 +++++ gdk-pixbuf/gdk-pixbuf-io.c | 6 +++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b721efbf7..f42b9564e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-22 Matthias Clasen + + * configure.in: Compare two content types, not content type + and mime type. + 2008-07-22 Sven Herzberg Fix svn:ignore and the include condition diff --git a/configure.in b/configure.in index 5a7d937cc..dc980446b 100644 --- a/configure.in +++ b/configure.in @@ -1044,8 +1044,10 @@ int main (int argc, char **argv) { char *content_type; + char *image_png; content_type = g_content_type_guess (NULL, data, data_size, NULL); - return !!strcmp (content_type, "image/png"); + image_png = g_content_type_for_mime_type ("image/png"); + return !!strcmp (content_type, image_png); }]])], [gio_can_sniff=yes AC_DEFINE(GDK_PIXBUF_USE_GIO_MIME, 1, [Define if gio can sniff image data])], diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index d1ef0ba8a..9fc9f9339 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,8 @@ +2008-07-23 Matthias Clasen + + * gdk-pixbuf-io.c (_gdk_pixbuf_get_module): Compare two content + types, not content type and mime type. + 2008-07-21 Matthias Clasen * === Released 2.13.5 === diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index e75fe9886..b5a822285 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -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);