Skip to content

Commit

Permalink
do not allocate new buffer for thumbnails with correct orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
nadvornik committed Jun 17, 2008
1 parent 304e05c commit 11224ad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/thumb.c
Expand Up @@ -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);
Expand Down
9 changes: 6 additions & 3 deletions src/thumb_standard.c
Expand Up @@ -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);
Expand Down

0 comments on commit 11224ad

Please sign in to comment.