# HG changeset patch # User zas_ # Date 1208682125 0 # Node ID f707aa712b1f73036561d3195b98623ac45d2cbe # Parent f0289d80ecc1921273f15923be552a49b7e3155b Fix the case "orientation from FileData, color profile from exif". Reported by Vladimir Nadvornik. diff -r f0289d80ecc1 -r f707aa712b1f src/image.c --- a/src/image.c Sat Apr 19 23:12:30 2008 +0000 +++ b/src/image.c Sun Apr 20 09:02:05 2008 +0000 @@ -1300,19 +1300,27 @@ { 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);