do not allocate new buffer for thumbnails with correct orientation
authorVladimir Nadvornik <nadvornik@suse.cz>
Tue, 17 Jun 2008 19:56:21 +0000 (19:56 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Tue, 17 Jun 2008 19:56:21 +0000 (19:56 +0000)
src/thumb.c
src/thumb_standard.c

index 495f353..05c64a9 100644 (file)
@@ -171,12 +171,15 @@ static void thumb_loader_done_cb(ImageLoader *il, gpointer data)
                        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);
index e96fbd9..5dbc421 100644 (file)
@@ -413,12 +413,15 @@ static GdkPixbuf *thumb_loader_std_finish(ThumbLoaderStd *tl, GdkPixbuf *pixbuf,
                        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);