# HG changeset patch # User zas_ # Date 1208641805 0 # Node ID 1b0aee2b162e3b2649a3f767a9862a23d80616d8 # Parent 5ddcf93278c788f5e725aec2c190cb7bcd47fa49 Keep image orientation set by the user during the session. diff -r 5ddcf93278c7 -r 1b0aee2b162e src/image.c --- a/src/image.c Sat Apr 19 21:30:19 2008 +0000 +++ b/src/image.c Sat Apr 19 21:50:05 2008 +0000 @@ -587,6 +587,18 @@ return; break; } + + if (type != ALTER_NONE && type != ALTER_DESATURATE) + { + if (imd->image_fd->user_orientation == 0) file_data_ref(imd->image_fd); + imd->image_fd->user_orientation = imd->orientation; + } + else + { + if (imd->image_fd->user_orientation != 0) file_data_unref(imd->image_fd); + imd->image_fd->user_orientation = 0; + } + pixbuf_renderer_set_orientation((PixbufRenderer *)imd->pr, imd->orientation); if (imd->cm || imd->desaturate) pixbuf_renderer_set_post_process_func((PixbufRenderer *)imd->pr, image_post_process_tile_color_cb, (gpointer) imd, (imd->cm != NULL) ); @@ -1290,17 +1302,19 @@ ExifData *exif = NULL; gint orientation; - if (options->image.exif_rotate_enable || + 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) ) { exif = exif_read_fd(imd->image_fd, (imd->color_profile_enable && imd->color_profile_use_image)); + + if (options->image.exif_rotate_enable && exif && exif_get_integer(exif, "Exif.Image.Orientation", &orientation)) + imd->orientation = orientation; + else + imd->orientation = 1; } - if (options->image.exif_rotate_enable && exif && 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); if (imd->cm) { diff -r 5ddcf93278c7 -r 1b0aee2b162e src/typedefs.h --- a/src/typedefs.h Sat Apr 19 21:30:19 2008 +0000 +++ b/src/typedefs.h Sat Apr 19 21:50:05 2008 +0000 @@ -411,6 +411,7 @@ FileDataChangeInfo *change; /* for rename, move ... */ GdkPixbuf *pixbuf; gint ref; + gint user_orientation; }; struct _LayoutWindow