eog/eog-2.19.4-svgz.patch

79 lines
2.4 KiB
Diff
Raw Normal View History

2007-07-10 14:55:11 +00:00
diff -up eog-2.19.4/src/eog-image.c.svgz eog-2.19.4/src/eog-image.c
--- eog-2.19.4/src/eog-image.c.svgz 2007-07-09 16:20:10.000000000 -0400
+++ eog-2.19.4/src/eog-image.c 2007-07-10 10:41:07.000000000 -0400
@@ -480,7 +480,7 @@ eog_image_apply_transformations (EogImag
2007-05-20 00:40:16 +00:00
}
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;
2007-07-10 14:55:11 +00:00
@@ -491,11 +491,14 @@ eog_image_determine_file_bytes (EogImage
2007-05-20 00:40:16 +00:00
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,
2007-07-10 14:55:11 +00:00
@@ -503,6 +506,8 @@ eog_image_determine_file_bytes (EogImage
2007-05-20 00:40:16 +00:00
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);
2007-07-10 14:55:11 +00:00
@@ -834,6 +839,7 @@ eog_image_real_load (EogImage *img,
2007-05-20 00:40:16 +00:00
GnomeVFSResult result;
EogMetadataReader *md_reader = NULL;
GdkPixbufFormat *format;
+ gchar *mime_type;
GdkPixbufLoader *loader = NULL;
guchar *buffer;
gboolean failed = FALSE;
2007-07-10 14:55:11 +00:00
@@ -852,9 +858,10 @@ eog_image_real_load (EogImage *img,
2007-05-20 00:40:16 +00:00
priv->file_type = NULL;
}
- priv->bytes = eog_image_determine_file_bytes (img, error);
+ priv->bytes = eog_image_determine_file_bytes (img, &mime_type, error);
2007-07-10 14:55:11 +00:00
if (priv->bytes == 0) {
+ g_free (mime_type);
2007-05-20 00:40:16 +00:00
return FALSE;
}
2007-07-10 14:55:11 +00:00
@@ -877,6 +884,7 @@ eog_image_real_load (EogImage *img,
2007-05-20 00:40:16 +00:00
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,
2007-07-10 14:55:11 +00:00
@@ -886,9 +894,12 @@ eog_image_real_load (EogImage *img,
2007-05-20 00:40:16 +00:00
}
buffer = g_new0 (guchar, EOG_IMAGE_READ_BUFFER_SIZE);
+ loader = gdk_pixbuf_loader_new_with_mime_type (mime_type, NULL);
+ g_free (mime_type);
+ if (loader == NULL)
+ loader = gdk_pixbuf_loader_new ();
if (read_image_data || read_only_dimension) {
- loader = gdk_pixbuf_loader_new ();
g_signal_connect_object (G_OBJECT (loader),
"size-prepared",