gtk+ r20897 - in trunk: . gdk-pixbuf



Author: matthiasc
Date: Wed Jul 23 04:20:15 2008
New Revision: 20897
URL: http://svn.gnome.org/viewvc/gtk+?rev=20897&view=rev

Log:
More correct content type handling


Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/gdk-pixbuf/ChangeLog
   trunk/gdk-pixbuf/gdk-pixbuf-io.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Wed Jul 23 04:20:15 2008
@@ -1044,8 +1044,10 @@
 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])],

Modified: trunk/gdk-pixbuf/gdk-pixbuf-io.c
==============================================================================
--- trunk/gdk-pixbuf/gdk-pixbuf-io.c	(original)
+++ trunk/gdk-pixbuf/gdk-pixbuf-io.c	Wed Jul 23 04:20:15 2008
@@ -770,6 +770,7 @@
 #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 @@
 
 		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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]