<para />\r
</section>\r
</section>\r
-</chapter>
+ <section id="ExifRotation">\r
+ <title>Exif Auto Rotation</title>\r
+ <para />\r
+ <section id="HowdotheExifauto-rotationcommandswork">\r
+ <title>How do the Exif auto-rotation commands work?</title>\r
+ <para>\r
+ Image auto-rotation works in either of two modes, set by\r
+ <link linkend="MetadataMiscellaneous">Write altered image orientation to the metadata</link>\r
+ option.\r
+ </para>\r
+ <para>\r
+ <guilabel>Write altered image orientation to the metadata not set</guilabel>\r
+ <para />\r
+ If you change the orientation of an image using any of the available commands, the image will always be displayed in the modified orientation. This new orientation is stored in temporary data structures associated with each image file. When Geeqie closes, these changes will be lost.\r
+ </para>\r
+ <warning>\r
+ <para>It is not possible to determine if the image as displayed is the original image or one which has been temporarily rotated.</para>\r
+ </warning>\r
+ <para>\r
+ If the option\r
+ <link linkend="Editmenu">Auto rotate image using EXIF information</link>\r
+ is selected, any images which have Exif orientation data will also be shown rotated. However, any rotation you have selected manually will always over-ride the embedded Exif rotation value.\r
+ </para>\r
+ <para>\r
+ <guilabel>Write altered image orientation to the metadata set</guilabel>\r
+ <para />\r
+ <para>If you change the orientation of an image using any of the available commands, this new orientation is stored in a metadata write queue.</para>\r
+ <para>\r
+ If the option\r
+ <link linkend="Editmenu">Auto rotate image using EXIF information</link>\r
+ is selected, any images which have Exif orientation data will be shown rotated, including any in the metadata write queue.\r
+ </para>\r
+ <para>\r
+ However if the option\r
+ <link linkend="Editmenu">Auto rotate image using EXIF information</link>\r
+ is not selected, no images will be auto-rotated. If you have manually rotated any images, the metadata write icon on the status bar will alert you to that fact. Clicking the icon will give a list of the modified files.\r
+ </para>\r
+ </para>\r
+ <para />\r
+ </section>\r
+ </section>\r
+</chapter>\r
<link linkend="MetadataMiscellaneous">Metadata tab of the Preferences Dialog</link>\r
if you wish these changes to be written to metadata.\r
</para>\r
+ <para>\r
+ Refer also to the\r
+ <link linkend="HowdotheExifauto-rotationcommandswork">FAQ</link>\r
+ .\r
+ </para>\r
</warning>\r
</listitem>\r
</varlistentry>\r
<para>Removes all temporary effects applied through the above commands, reverting the image according to its Exif Orientation tag.</para>\r
</listitem>\r
</varlistentry>\r
+ <varlistentry>\r
+ <term>\r
+ <guilabel>Auto rotate image using EXIF information</guilabel>\r
+ </term>\r
+ <listitem>\r
+ <para>\r
+ Auto rotates images based on metadata stored in images that have Exif data. Refer also to the\r
+ <link linkend="HowdotheExifauto-rotationcommandswork">FAQ</link>\r
+ .\r
+ </para>\r
+ </listitem>\r
+ </varlistentry>\r
<varlistentry>\r
<term>\r
<menuchoice>\r
<title>Buttons</title>\r
<para>Statusbar buttons corresponds to selected menu action.</para>\r
<para />\r
+ <section id="ExifRotate">\r
+ <title>Exif rotate</title>\r
+ <para>\r
+ <guiicon>\r
+ <inlinegraphic fileref="gtk-color-picker.png" />\r
+ </guiicon>\r
+ Toggles the auto-rotation of images if they have Exif orientation data. \r
+ Refer also to the\r
+ <link linkend="HowdotheExifauto-rotationcommandswork">FAQ</link>\r
+ .\r
+ </para>\r
+ <para />\r
+ </section>\r
<section id="ShowPixelInfo">\r
<title>Show Pixel Info</title>\r
<para>\r
<para />\r
</section>\r
</section>\r
-</section>
+</section>\r
<section id="Convenience">\r
<title>Convenience</title>\r
<variablelist>\r
- <varlistentry>\r
- <term>\r
- <guilabel>Auto rotate image using EXIF information</guilabel>\r
- </term>\r
- <listitem>\r
- <para>Auto rotates images based on metadata stored in images that have Exif data.</para>\r
- </listitem>\r
- </varlistentry>\r
- <varlistentry>\r
+ <varlistentry>\r
<term>\r
<guilabel>Auto rotate proofs using EXIF information</guilabel>\r
</term>\r
<listitem>\r
- <para>TBD</para>\r
+ <para>Auto rotate images on print proof sheet.</para>\r
</listitem>\r
</varlistentry>\r
</variablelist>\r
<para>\r
<guilabel>Write altered image orientation to the metadata</guilabel>\r
<para />\r
- If checked, the results of orientation commands (Rotate, Mirror and Flip) issued on an image will be written to metadata either automatically as specified below or when manually initiated.\r
+ If checked, the results of orientation commands (Rotate, Mirror and Flip) issued on an image will be written to metadata either automatically as specified below or when manually initiated. This option also affects the\r
+ <link linkend="Editmenu">Auto rotate image using EXIF information</link>\r
+ menu item.\r
</para>\r
<warning>\r
<para>If this option is not checked, the results of orientation commands will be lost when Geeqie closes.</para>\r
+ <para>Do not change this option while you have temporary rotations applied to images.</para>\r
</warning>\r
</listitem>\r
</itemizedlist>\r
#include "color-man.h"
#include "dnd.h"
#include "editors.h"
+#include "exif.h"
#include "filedata.h"
#include "fullscreen.h"
#include "image.h"
#include "layout.h"
#include "layout_util.h"
#include "menu.h"
+#include "metadata.h"
#include "misc.h"
#include "pixbuf_util.h"
#include "pixbuf-renderer.h"
image_alter_orientation(lw->image, type);
}
+void layout_image_reset_orientation(LayoutWindow *lw)
+{
+ ImageWindow *imd= lw->image;
+
+ if (!layout_valid(&lw)) return;
+ if (!imd || !imd->pr || !imd->image_fd) return;
+
+ if (imd->orientation < 1 || imd->orientation > 8) imd->orientation = 1;
+
+ if (options->image.exif_rotate_enable)
+ {
+ imd->orientation = metadata_read_int(imd->image_fd, ORIENTATION_KEY, EXIF_ORIENTATION_TOP_LEFT);
+ }
+ else
+ {
+ imd->orientation = 1;
+ }
+
+ if (imd->image_fd->user_orientation != 0)
+ {
+ imd->orientation = imd->image_fd->user_orientation;
+ }
+
+ pixbuf_renderer_set_orientation((PixbufRenderer *)imd->pr, imd->orientation);
+}
+
void layout_image_set_desaturate(LayoutWindow *lw, gboolean desaturate)
{
if (!layout_valid(&lw)) return;
void layout_image_overlay_toggle(LayoutWindow *lw);
void layout_image_notify_cb(FileData *fd, NotifyType type, gpointer data);
-
+void layout_image_reset_orientation(LayoutWindow *lw);
#endif
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
layout_image_alter_orientation(lw, ALTER_NONE);
}
+static void layout_menu_exif_rotate_cb(GtkToggleAction *action, gpointer data)
+{
+ LayoutWindow *lw = data;
+
+ options->image.exif_rotate_enable = gtk_toggle_action_get_active(action);
+ layout_image_reset_orientation(lw);
+}
+
static void layout_menu_config_cb(GtkAction *action, gpointer data)
{
LayoutWindow *lw = data;
{ "ImageHistogram", NULL, N_("_Show Histogram"), NULL, N_("Show Histogram"), CB(layout_menu_histogram_cb), FALSE },
{ "RectangularSelection", NULL, N_("Rectangular Selection"), "<alt>R", N_("Rectangular Selection"), CB(layout_menu_rectangular_selection_cb), FALSE },
{ "Animate", NULL, N_("GIF _animation"), "A", N_("Toggle GIF animation"), CB(layout_menu_animate_cb), FALSE },
+ { "ExifRotate", GTK_STOCK_ORIENTATION_PORTRAIT, N_("_Exif rotate"), "<alt>X", N_("Exif rotate"), CB(layout_menu_exif_rotate_cb), FALSE },
};
static GtkRadioActionEntry menu_radio_entries[] = {
" <menuitem action='Mirror'/>"
" <menuitem action='Flip'/>"
" <menuitem action='AlterNone'/>"
+" <separator/>"
+" <menuitem action='ExifRotate'/>"
+" <separator/>"
" </menu>"
" <menuitem action='SaveMetadata'/>"
" <placeholder name='PropertiesSection'/>"
" <toolitem action='FloatTools'/>"
" </toolbar>"
" <toolbar name='StatusBar'>"
+" <toolitem action='ExifRotate'/>"
" <toolitem action='ShowInfoPixel'/>"
" <toolitem action='UseColorProfiles'/>"
" <toolitem action='SaveMetadata'/>"
action = gtk_action_group_get_action(lw->action_group, "ImageHistogram");
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), osd_flags & OSD_SHOW_HISTOGRAM);
+ action = gtk_action_group_get_action(lw->action_group, "ExifRotate");
+ gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), options->image.exif_rotate_enable);
+
+ action = gtk_action_group_get_action(lw->action_group, "RectangularSelection");
+ gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), options->collections.rectangular_selection);
+
if (osd_flags & OSD_SHOW_HISTOGRAM)
{
action = gtk_action_group_get_action(lw->action_group, "HistogramChanR");
options->image_overlay.background_blue = c_options->image_overlay.background_blue;
options->image_overlay.background_alpha = c_options->image_overlay.background_alpha;
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;
group = pref_group_new(vbox, FALSE, _("Convenience"), GTK_ORIENTATION_VERTICAL);
- 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);
}