-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there,

as directed by Guilhem, here's a small patch that corrects bug 2956131.
I made an initial patch which had a horrible memleak which then was
fixed by Hilko Bengen.

Cheers,
        Gerhard
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkuWthkACgkQfg6TFvELooSZ/gCeNDaGHTgtmLSnoc5pnj7ucWvt
mdUAn2YFwiA5Wfm3xPInAyVyex/lYXeo
=nNxB
-----END PGP SIGNATURE-----
diff --git a/src/thumbnails.c b/src/thumbnails.c
index dc8f8a9..0461114 100644
--- a/src/thumbnails.c
+++ b/src/thumbnails.c
@@ -142,9 +142,12 @@ GdkPixbuf *a_thumbnails_scale_pixbuf(GdkPixbuf *src, int max_w, int max_h)
 
 static GdkPixbuf *child_create_thumbnail(const gchar *path)
 {
-	GdkPixbuf *image;
+	GdkPixbuf *image, *tmpbuf;
 
 	image = gdk_pixbuf_new_from_file(path, NULL);
+	tmpbuf = gdk_pixbuf_apply_embedded_orientation(image);
+	g_object_unref(G_OBJECT(image));
+	image = tmpbuf;
 
 	if (image)
         {
@@ -161,6 +164,7 @@ static GdkPixbuf *save_thumbnail(const char *pathname, GdkPixbuf *full)
 	struct stat info;
 	gchar *path;
 	int original_width, original_height;
+	const gchar* orientation;
 	GString *to;
 	char *md5, *swidth, *sheight, *ssize, *smtime, *uri;
 	mode_t old_mask;
@@ -172,6 +176,8 @@ static GdkPixbuf *save_thumbnail(const char *pathname, GdkPixbuf *full)
 
 	thumb = a_thumbnails_scale_pixbuf(full, PIXMAP_THUMB_SIZE, PIXMAP_THUMB_SIZE);
 
+	orientation = gdk_pixbuf_get_option (full, "orientation");
+
 	original_width = gdk_pixbuf_get_width(full);
 	original_height = gdk_pixbuf_get_height(full);
 
@@ -208,6 +214,7 @@ static GdkPixbuf *save_thumbnail(const char *pathname, GdkPixbuf *full)
 			"tEXt::Thumb::MTime", smtime,
 			"tEXt::Thumb::URI", uri,
 			"tEXt::Software", PROJECT,
+			"tEXt::Software::Orientation", orientation ? orientation : "0",
 			NULL);
 	umask(old_mask);
 
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to