]> Pileus Git - ~andy/gtk/commitdiff
More correct content type handling
authorMatthias Clasen <matthiasc@src.gnome.org>
Wed, 23 Jul 2008 04:20:15 +0000 (04:20 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 23 Jul 2008 04:20:15 +0000 (04:20 +0000)
svn path=/trunk/; revision=20897

ChangeLog
configure.in
gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-io.c

index b721efbf72959b77e08a03c52ba8f90d9866690c..f42b9564e2369371f7ba2c9047a62a4e673cd78c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-07-22  Matthias Clasen  <mclasen@redhat.com>
+
+       * configure.in: Compare two content types, not content type
+       and mime type.
+
 2008-07-22  Sven Herzberg  <sven@imendio.com>
 
        Fix svn:ignore and the include condition
index 5a7d937ccfa29643148b2b84b0cb4c0fdfea3407..dc980446b3c44b54f84869f7dc6c5ffb7959787d 100644 (file)
@@ -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])],
index d1ef0ba8ade4eac9110b83b10d8461b70ce562e2..9fc9f9339009db8d164533bc0e2eaf7aeefa0697 100644 (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 ===
index e75fe98863ba8ebc0e3994932dfb4f4037f52d2b..b5a8222856f1981976007bbfefcbb76e0f9621d1 100644 (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);