[gthumb] return the original size when loading a thumbnail
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] return the original size when loading a thumbnail
- Date: Wed, 15 Sep 2010 19:13:39 +0000 (UTC)
commit 2cc100bbffb8f5546b88483a1925e4fd70e6ceaa
Author: Paolo Bacchilega <paobac src gnome org>
Date: Wed Sep 15 21:08:59 2010 +0200
return the original size when loading a thumbnail
gthumb/gnome-desktop-thumbnail.c | 2 ++
gthumb/gth-thumb-loader.c | 5 +++++
2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gthumb/gnome-desktop-thumbnail.c b/gthumb/gnome-desktop-thumbnail.c
index aaa3c32..6402360 100644
--- a/gthumb/gnome-desktop-thumbnail.c
+++ b/gthumb/gnome-desktop-thumbnail.c
@@ -765,11 +765,13 @@ gnome_desktop_thumbnail_factory_generate_no_script (GnomeDesktopThumbnailFactory
{
g_snprintf (dimension, sizeof (dimension), "%i", original_width);
gdk_pixbuf_set_option (pixbuf, "tEXt::Thumb::Image::Width", dimension);
+ g_object_set_data (G_OBJECT (pixbuf), "gnome-original-width", GINT_TO_POINTER (original_width));
}
if (original_height > 0)
{
g_snprintf (dimension, sizeof (dimension), "%i", original_height);
gdk_pixbuf_set_option (pixbuf, "tEXt::Thumb::Image::Height", dimension);
+ g_object_set_data (G_OBJECT (pixbuf), "gnome-original-height", GINT_TO_POINTER (original_height));
}
return pixbuf;
diff --git a/gthumb/gth-thumb-loader.c b/gthumb/gth-thumb-loader.c
index 001e3aa..4ab901a 100644
--- a/gthumb/gth-thumb-loader.c
+++ b/gthumb/gth-thumb-loader.c
@@ -179,6 +179,11 @@ load_thumbnail (GthFileData *file_data,
}
if (pixbuf != NULL) {
+ if (original_width != NULL)
+ *original_width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (pixbuf), "gnome-original-width"));
+ if (original_height != NULL)
+ *original_height = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (pixbuf), "gnome-original-height"));
+
g_clear_error (error);
animation = gdk_pixbuf_non_anim_new (pixbuf);
g_object_unref (pixbuf);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]