--- eog-2.16.0.1/libeog/eog-image.c.handle-svgz	2006-12-19 13:31:51.000000000 -0500
+++ eog-2.16.0.1/libeog/eog-image.c	2006-12-19 13:34:26.000000000 -0500
@@ -460,7 +460,7 @@
 }
 
 static GnomeVFSFileSize
-eog_image_determine_file_bytes (EogImage *img, GError **error)
+eog_image_determine_file_bytes (EogImage *img, gchar **mime_type, GError **error)
 {
 	GnomeVFSFileInfo *info;
 	GnomeVFSFileSize bytes;
@@ -471,15 +471,20 @@
 	result = gnome_vfs_get_file_info_uri (img->priv->uri,
 					      info,
 					      GNOME_VFS_FILE_INFO_DEFAULT |
+                                              GNOME_VFS_FILE_INFO_GET_MIME_TYPE |
 					      GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
 
 	if ((result != GNOME_VFS_OK) || (info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE) == 0) {
 		bytes = 0;
+                if (mime_type)
+                       *mime_type = NULL;
 		g_set_error (error, EOG_IMAGE_ERROR, EOG_IMAGE_ERROR_VFS,
 			     gnome_vfs_result_to_string (result));
 	}
 	else {
 		bytes = info->size;
+                if (mime_type)
+                       *mime_type = g_strdup (info->mime_type);
 	}
 
 	gnome_vfs_file_info_unref (info);
@@ -511,7 +516,7 @@
 
 	g_assert (priv->image == NULL);
 
-	priv->bytes = eog_image_determine_file_bytes (img, error);
+	priv->bytes = eog_image_determine_file_bytes (img, NULL, error);
 	if (priv->bytes == 0 && (error == NULL || *error != NULL)) {
 		return FALSE;
 	}
@@ -749,6 +754,7 @@
 	gboolean first_run = TRUE;
 	EogMetadataReader *md_reader = NULL;
 	GdkPixbufFormat *format;
+        gchar *mime_type;
 
 	g_assert (error == NULL || *error == NULL);
 
@@ -765,20 +771,25 @@
 		priv->file_type = NULL;
 	}
 
-	priv->bytes = eog_image_determine_file_bytes (img, error);
+	priv->bytes = eog_image_determine_file_bytes (img, &mime_type, error);
 	if (priv->bytes == 0 && (error == NULL || *error != NULL)) {
+		g_free (mime_type);
 		return FALSE;
 	}
 
 	result = gnome_vfs_open_uri (&handle, priv->uri, GNOME_VFS_OPEN_READ);
 	if (result != GNOME_VFS_OK) {
+                g_free (mime_type);
 		g_set_error (error, EOG_IMAGE_ERROR, EOG_IMAGE_ERROR_VFS,
 			     gnome_vfs_result_to_string (result));
 		return FALSE;
 	}
 	
 	buffer = g_new0 (guchar, READ_BUFFER_SIZE);
-	loader = gdk_pixbuf_loader_new ();
+        loader = gdk_pixbuf_loader_new_with_mime_type (mime_type, NULL);
+        g_free (mime_type);
+        if (loader == NULL)
+	       loader = gdk_pixbuf_loader_new ();
 	failed = FALSE;
 	bytes_read_total = 0;
 
