exif autorotate for proofs
authorJonathan Woithe <jwoithe@physics.adelaide.edu.au>
Fri, 2 Apr 2010 11:17:34 +0000 (20:47 +0930)
committerLaurent Monin <zas@norz.org>
Thu, 16 Aug 2012 21:27:08 +0000 (23:27 +0200)
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.

src/options.c
src/options.h
src/preferences.c
src/print.c

index 670d6ef..5de7d4f 100644 (file)
@@ -65,6 +65,7 @@ ConfOptions *init_options(ConfOptions *options)
        memset(&options->image.border_color, 0, sizeof(options->image.border_color));
        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;
index 118856b..cb78906 100644 (file)
@@ -50,6 +50,7 @@ struct _ConfOptions
        /* image */
        struct {
                gboolean exif_rotate_enable;
+               gboolean exif_proof_rotate_enable;
                guint scroll_reset_method;
                gboolean fit_window_to_image;
                gboolean limit_window_size;
index d0f4d1b..cf200b5 100644 (file)
@@ -285,6 +285,7 @@ static void config_window_apply(void)
 
        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;
 
@@ -1466,6 +1467,9 @@ static void config_tab_image(GtkWidget *notebook)
 
        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 */
index d8e721f..07ebd50 100644 (file)
@@ -2206,6 +2206,10 @@ static void print_job_render_proof_loader_done(ImageLoader *il, gpointer data)
 
        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);