eog r4531 - in trunk: . src



Author: csaavedra
Date: Sun Apr 13 01:46:48 2008
New Revision: 4531
URL: http://svn.gnome.org/viewvc/eog?rev=4531&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:
   trunk/ChangeLog
   trunk/src/eog-image.c
   trunk/src/eog-jobs.c
   trunk/src/eog-thumbnail.h

Modified: trunk/src/eog-image.c
==============================================================================
--- trunk/src/eog-image.c	(original)
+++ trunk/src/eog-image.c	Sun Apr 13 01:46:48 2008
@@ -40,6 +40,7 @@
 #include "eog-transform.h"
 #include "eog-util.h"
 #include "eog-jobs.h"
+#include "eog-thumbnail.h"
 
 #include <unistd.h>
 
@@ -785,24 +786,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: trunk/src/eog-jobs.c
==============================================================================
--- trunk/src/eog-jobs.c	(original)
+++ trunk/src/eog-jobs.c	Sun Apr 13 01:46:48 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: trunk/src/eog-thumbnail.h
==============================================================================
--- trunk/src/eog-thumbnail.h	(original)
+++ trunk/src/eog-thumbnail.h	Sun Apr 13 01:46:48 2008
@@ -40,6 +40,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]