Skip to content

Commit

Permalink
exif autorotate for proofs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jonathan Woithe authored and zas committed Aug 16, 2012
1 parent cbdf3ec commit b73335c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/preferences.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 */
Expand Down
4 changes: 4 additions & 0 deletions src/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit b73335c

Please sign in to comment.