Skip to content

Commit

Permalink
Fix the case "orientation from FileData, color profile from exif".
Browse files Browse the repository at this point in the history
Reported by Vladimir Nadvornik.
  • Loading branch information
Laurent Monin committed Apr 20, 2008
1 parent 448b0fb commit c648cdf
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1300,19 +1300,27 @@ void image_change_pixbuf(ImageWindow *imd, GdkPixbuf *pixbuf, gdouble zoom)
{

ExifData *exif = NULL;
gint orientation;
gint read_exif_for_color_profile = (imd->color_profile_enable && imd->color_profile_use_image);
gint read_exif_for_orientation = FALSE;

if (imd->image_fd && imd->image_fd->user_orientation)
imd->orientation = imd->image_fd->user_orientation;
else if (options->image.exif_rotate_enable ||
(imd->color_profile_enable && imd->color_profile_use_image) )
else if (options->image.exif_rotate_enable)
read_exif_for_orientation = TRUE;

if (read_exif_for_color_profile || read_exif_for_orientation)
{
exif = exif_read_fd(imd->image_fd, (imd->color_profile_enable && imd->color_profile_use_image));
gint orientation;

exif = exif_read_fd(imd->image_fd, read_exif_for_color_profile);

if (options->image.exif_rotate_enable && exif && exif_get_integer(exif, "Exif.Image.Orientation", &orientation))
imd->orientation = orientation;
else
imd->orientation = 1;
if (exif && read_exif_for_orientation)
{
if (exif_get_integer(exif, "Exif.Image.Orientation", &orientation))
imd->orientation = orientation;
else
imd->orientation = 1;
}
}

pixbuf_renderer_set_post_process_func((PixbufRenderer *)imd->pr, NULL, NULL, FALSE);
Expand Down

0 comments on commit c648cdf

Please sign in to comment.