[maemo-commits] [maemo-commits] r17452 - in projects/haf/trunk/hildon-thumbnail: tests thumbs

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Feb 17 15:01:25 EET 2009
Author: pvanhoof
Date: 2009-02-17 15:01:24 +0200 (Tue, 17 Feb 2009)
New Revision: 17452

Modified:
   projects/haf/trunk/hildon-thumbnail/tests/artist-art-test.c
   projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.c
   projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.h
Log:
Bugfix

Modified: projects/haf/trunk/hildon-thumbnail/tests/artist-art-test.c
===================================================================
--- projects/haf/trunk/hildon-thumbnail/tests/artist-art-test.c	2009-02-17 12:51:56 UTC (rev 17451)
+++ projects/haf/trunk/hildon-thumbnail/tests/artist-art-test.c	2009-02-17 13:01:24 UTC (rev 17452)
@@ -16,6 +16,7 @@
 on_art_back (HildonAlbumartFactoryHandle handle, gpointer user_data, GdkPixbuf *albumart, GError *error)
 {
 	if (albumart) {
+
 		gtk_image_set_from_pixbuf (user_data, albumart);
 	}
 }
@@ -24,7 +25,10 @@
 on_art_back (HildonAlbumartFactory *self, GdkPixbuf *albumart, GError *error, gpointer user_data)
 {
 	if (albumart) {
-		gtk_image_set_from_pixbuf (user_data, albumart);
+		GdkPixbuf *b = hildon_thumbnail_orientate ("file:///home/user/.cache/media-art/album-325dca7d85d2b6a2f09f2486c125e5fc-681aeee31930af7af8d1ee209ba0195f.jpeg", 
+		                                       "2", albumart);
+		gtk_image_set_from_pixbuf (user_data, b);
+		g_object_unref (b);
 	}
 }
 #endif

Modified: projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.c
===================================================================
--- projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.c	2009-02-17 12:51:56 UTC (rev 17451)
+++ projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.c	2009-02-17 13:01:24 UTC (rev 17452)
@@ -258,7 +258,7 @@
 		}
 
 		/* Rotate 90 CW  */
-		if (g_strcmp0 (values[0], "6")) {
+		if (g_strcmp0 (orientation, "6")) {
 			ret = gdk_pixbuf_rotate_simple (image, GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE);
 			rotated = TRUE;
 		}
@@ -283,8 +283,8 @@
 	if (values)
 		g_strfreev (values);
 
-	if (rotated)
-		g_object_unref (image);
+	if (!rotated)
+		g_object_ref (image);
 
 	return ret;
 }

Modified: projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.h
===================================================================
--- projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.h	2009-02-17 12:51:56 UTC (rev 17451)
+++ projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.h	2009-02-17 13:01:24 UTC (rev 17452)
@@ -77,11 +77,8 @@
  * @orientation: optional orientation (if you know it already, pass it here, NULL otherwise)
  * @image: GdkPixbuf of the thumbnail
  *
- * Rotates @image and then returns the rotated version. When rotated @image will
- * be unreferenced once. Which means that you should do something like this:
- * image = hildon_thumbnail_orientate (uri, image) and it wont create a memory
- * leak. If no rotation was necessary then @image will just be returned back to
- * you.
+ * Rotates @image and then returns the rotated version.. If no rotation was 
+ * necessary then @image will just be returned back to you with a reference added.
  *
  * Returns: @image or the rotated version of @image depending on the necessity 
  * of rotating.


More information about the maemo-commits mailing list