changeset 842:94048d7843ba

do not allocate new buffer for thumbnails with correct orientation
author nadvornik
date Tue, 17 Jun 2008 19:56:21 +0000
parents 64ef209bcded
children add46f9c895c
files src/thumb.c src/thumb_standard.c
diffstat 2 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/thumb.c	Mon Jun 16 19:07:02 2008 +0000
+++ b/src/thumb.c	Tue Jun 17 19:56:21 2008 +0000
@@ -171,12 +171,15 @@
 			if (exif && exif_get_integer(exif, "Exif.Image.Orientation", &orientation))
 				tl->fd->exif_orientation = orientation;
 			else
-				tl->fd->exif_orientation = 1;
+				tl->fd->exif_orientation = EXIF_ORIENTATION_TOP_LEFT;
 			exif_free(exif);
 			}
 		
-		rotated = pixbuf_apply_orientation(pixbuf, tl->fd->exif_orientation);
-		pixbuf = rotated;
+		if (tl->fd->exif_orientation != EXIF_ORIENTATION_TOP_LEFT)
+			{
+			rotated = pixbuf_apply_orientation(pixbuf, tl->fd->exif_orientation);
+			pixbuf = rotated;
+			}
 		}
 
 	pw = gdk_pixbuf_get_width(pixbuf);
--- a/src/thumb_standard.c	Mon Jun 16 19:07:02 2008 +0000
+++ b/src/thumb_standard.c	Tue Jun 17 19:56:21 2008 +0000
@@ -413,12 +413,15 @@
 			if (exif && exif_get_integer(exif, "Exif.Image.Orientation", &orientation))
 				tl->fd->exif_orientation = orientation;
 			else
-				tl->fd->exif_orientation = 1;
+				tl->fd->exif_orientation = EXIF_ORIENTATION_TOP_LEFT;
 			exif_free(exif);
 			}
 		
-		rotated = pixbuf_apply_orientation(pixbuf, tl->fd->exif_orientation);
-		pixbuf = rotated;
+		if (tl->fd->exif_orientation != EXIF_ORIENTATION_TOP_LEFT)
+			{
+			rotated = pixbuf_apply_orientation(pixbuf, tl->fd->exif_orientation);
+			pixbuf = rotated;
+			}
 		}
 
 	sw = gdk_pixbuf_get_width(pixbuf);