changeset 2219:6e91033c7fb3

exif autorotate for proofs Find below a patch which adds auto-rotation of proof images based on image EXIF information. It is a revision of a proof-of-concept patch I did up for gqview 2.0.4 which, for well documented reasons, didn't get anywhere after submission. The patch below is against geeqie 1.0. The proof auto-rotation feature is controlled by a new setting in the "convenience" section of the image preferences dialog. This way the existing behaviour is still available for those who want to use it. I find this new feature very useful when preparing proofing sheets and I suspect others would too. Please consider this for inclusion in geeqie.
author Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
date Fri, 02 Apr 2010 20:47:34 +0930
parents 546923147030
children fea4dd5c4359
files src/options.c src/options.h src/preferences.c src/print.c
diffstat 4 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/options.c	Fri Jan 06 02:23:57 2012 +0100
+++ b/src/options.c	Fri Apr 02 20:47:34 2010 +0930
@@ -66,6 +66,7 @@
 	options->image.dither_quality = GDK_RGB_DITHER_NORMAL;
 	options->image.enable_read_ahead = TRUE;
 	options->image.exif_rotate_enable = TRUE;
+	options->image.exif_proof_rotate_enable = TRUE;
 	options->image.fit_window_to_image = FALSE;
 	options->image.limit_autofit_size = FALSE;
 	options->image.limit_window_size = TRUE;
--- a/src/options.h	Fri Jan 06 02:23:57 2012 +0100
+++ b/src/options.h	Fri Apr 02 20:47:34 2010 +0930
@@ -50,6 +50,7 @@
 	/* image */
 	struct {
 		gboolean exif_rotate_enable;
+		gboolean exif_proof_rotate_enable;
 		guint scroll_reset_method;
 		gboolean fit_window_to_image;
 		gboolean limit_window_size;
--- a/src/preferences.c	Fri Jan 06 02:23:57 2012 +0100
+++ b/src/preferences.c	Fri Apr 02 20:47:34 2010 +0930
@@ -285,6 +285,7 @@
 		
 	options->update_on_time_change = c_options->update_on_time_change;
 	options->image.exif_rotate_enable = c_options->image.exif_rotate_enable;
+	options->image.exif_proof_rotate_enable = c_options->image.exif_proof_rotate_enable;
 
 	options->duplicates_similarity_threshold = c_options->duplicates_similarity_threshold;
 
@@ -1420,6 +1421,9 @@
 
 	pref_checkbox_new_int(group, _("Auto rotate image using Exif information"),
 			      options->image.exif_rotate_enable, &c_options->image.exif_rotate_enable);
+
+	pref_checkbox_new_int(group, _("Auto rotate proofs using Exif information"),
+			      options->image.exif_proof_rotate_enable, &c_options->image.exif_proof_rotate_enable);
 }
 
 /* windows tab */
--- a/src/print.c	Fri Jan 06 02:23:57 2012 +0100
+++ b/src/print.c	Fri Apr 02 20:47:34 2010 +0930
@@ -2206,6 +2206,10 @@
 
 	pixbuf = image_loader_get_pixbuf(il);
 
+	if (options->image.exif_proof_rotate_enable == TRUE) {
+		pixbuf = pixbuf_apply_orientation(pixbuf, il->fd->exif_orientation);
+	}
+
 	w = gdk_pixbuf_get_width(pixbuf);
 	h = gdk_pixbuf_get_height(pixbuf);