eog r4533 - in branches/gnome-2-22: . src



Author: csaavedra
Date: Sun Apr 13 02:18:36 2008
New Revision: 4533
URL: http://svn.gnome.org/viewvc/eog?rev=4533&view=rev

Log:
2008-04-12  Claudio Saavedra  <csaavedra gnome org>

	* src/eog-image.c: (eog_image_get_dimension_from_thumbnail):
	* src/eog-jobs.c: (eog_job_thumbnail_run):
	* src/eog-thumbnail.h: Store original image dimensions as a
	GObject property instead of a pixbuf option, to avoid using the
	private gdk_pixbuf_set_option. Fixes bug #527798.



Modified:
   branches/gnome-2-22/ChangeLog
   branches/gnome-2-22/src/eog-image.c
   branches/gnome-2-22/src/eog-jobs.c
   branches/gnome-2-22/src/eog-thumbnail.h

Modified: branches/gnome-2-22/src/eog-image.c
==============================================================================
--- branches/gnome-2-22/src/eog-image.c	(original)
+++ branches/gnome-2-22/src/eog-image.c	Sun Apr 13 02:18:36 2008
@@ -40,6 +40,7 @@
 #include "eog-transform.h"
 #include "eog-util.h"
 #include "eog-jobs.h"
+#include "eog-thumbnail.h"
 
 #include <unistd.h>
 
@@ -906,24 +907,15 @@
 			                gint     *width,
 			                gint     *height)
 {
-	const char *w, *h;
-
 	if (image->priv->thumbnail == NULL)
 		return FALSE;
-	
-	w = gdk_pixbuf_get_option (image->priv->thumbnail,
-				   "tEXt::Thumb::Image::Width");
 
-	h = gdk_pixbuf_get_option (image->priv->thumbnail,
-				   "tEXt::Thumb::Image::Height");
-	
-	if (w)
-		sscanf (w, "%i", width);
+	*width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (image->priv->thumbnail),
+						     EOG_THUMBNAIL_ORIGINAL_WIDTH));
+	*height = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (image->priv->thumbnail),
+						      EOG_THUMBNAIL_ORIGINAL_HEIGHT));
 
-	if (h)
-		sscanf (h, "%i", height);
-	
-	return (w && h);
+	return (*width || *height);
 }
 
 static gboolean

Modified: branches/gnome-2-22/src/eog-jobs.c
==============================================================================
--- branches/gnome-2-22/src/eog-jobs.c	(original)
+++ branches/gnome-2-22/src/eog-jobs.c	Sun Apr 13 02:18:36 2008
@@ -193,7 +193,8 @@
 eog_job_thumbnail_run (EogJobThumbnail *job)
 {
 	gchar *orig_width, *orig_height;
-
+	gint width, height;
+	
 	g_return_if_fail (EOG_IS_JOB_THUMBNAIL (job));
 	
 	if (EOG_JOB (job)->error) {
@@ -216,15 +217,17 @@
 	eog_thumbnail_add_frame (&job->thumbnail);
 
 	if (orig_width) {
-		gdk_pixbuf_set_option (job->thumbnail,
-				       "tEXt::Thumb::Image::Width", orig_width);
-
+		sscanf (orig_width, "%i", &width);
+		g_object_set_data (G_OBJECT (job->thumbnail),
+				   EOG_THUMBNAIL_ORIGINAL_WIDTH,
+				   GINT_TO_POINTER (width));
 		g_free (orig_width);
 	}
 	if (orig_height) {
-		gdk_pixbuf_set_option (job->thumbnail,
-				       "tEXt::Thumb::Image::Height", orig_height);
-
+		sscanf (orig_height, "%i", &height);
+		g_object_set_data (G_OBJECT (job->thumbnail),
+				   EOG_THUMBNAIL_ORIGINAL_HEIGHT,
+				   GINT_TO_POINTER (height));
 		g_free (orig_height);
 	}
 	

Modified: branches/gnome-2-22/src/eog-thumbnail.h
==============================================================================
--- branches/gnome-2-22/src/eog-thumbnail.h	(original)
+++ branches/gnome-2-22/src/eog-thumbnail.h	Sun Apr 13 02:18:36 2008
@@ -41,6 +41,8 @@
 GdkPixbuf*    eog_thumbnail_load        (EogImage *image, 
 					 GError **error);
 
+#define EOG_THUMBNAIL_ORIGINAL_WIDTH  "eog-thumbnail-orig-width"
+#define EOG_THUMBNAIL_ORIGINAL_HEIGHT "eog-thumbnail-orig-height"
 
 G_END_DECLS
 



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