Index: data/gthumb.schemas.in
===================================================================
RCS file: /cvs/gnome/gthumb/data/gthumb.schemas.in,v
retrieving revision 1.20
diff -u -p -r1.20 gthumb.schemas.in
--- data/gthumb.schemas.in	23 Dec 2005 17:48:21 -0000	1.20
+++ data/gthumb.schemas.in	28 Sep 2006 13:26:30 -0000
@@ -95,7 +95,20 @@
 	</locale>
       </schema>
 
-      <!-- Broswer -->
+      <schema>
+	<key>/schemas/apps/gthumb/general/use_exif_orientation</key>
+	<applyto>/apps/gthumb/general/use_exif_orientation</applyto>
+	<owner>gthumb</owner>
+	<type>bool</type>
+	<default>true</default>
+	<locale name="C">
+	  <short></short>
+	  <long>
+	  </long>
+	</locale>
+      </schema>
+
+      <!-- Browser -->
 
       <schema>
 	<key>/schemas/apps/gthumb/browser/show_hidden_files</key>
Index: data/glade/gthumb_preferences.glade
===================================================================
RCS file: /cvs/gnome/gthumb/data/glade/gthumb_preferences.glade,v
retrieving revision 1.5
diff -u -p -r1.5 gthumb_preferences.glade
--- data/glade/gthumb_preferences.glade	27 Sep 2005 15:03:27 -0000	1.5
+++ data/glade/gthumb_preferences.glade	28 Sep 2006 13:26:34 -0000
@@ -785,6 +785,147 @@
 		  <property name="fill">True</property>
 		</packing>
 	      </child>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox62">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">6</property>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox122">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">5</property>
+
+		      <child>
+			<widget class="GtkLabel" id="label189">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">&lt;b&gt;To rotate images with Exif orientation tag support:&lt;/b&gt;</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">True</property>
+			  <property name="justify">GTK_JUSTIFY_CENTER</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox123">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkLabel" id="label190">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">    </property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkVBox" id="vbox63">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">6</property>
+
+			  <child>
+			    <widget class="GtkRadioButton" id="radio_exif_use_orientation_tag">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="label" translatable="yes">Adjust orientation tag. Leave image data unchanged.</property>
+			      <property name="use_underline">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
+			      <property name="active">False</property>
+			      <property name="inconsistent">False</property>
+			      <property name="draw_indicator">True</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkRadioButton" id="radio_exif_use_image_transform">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="label" translatable="yes">Adjust image data. Reset orientation tag to top-left.</property>
+			      <property name="use_underline">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
+			      <property name="active">False</property>
+			      <property name="inconsistent">False</property>
+			      <property name="draw_indicator">True</property>
+			      <property name="group">radio_exif_use_orientation_tag</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
 	    </widget>
 	    <packing>
 	      <property name="tab_expand">False</property>
Index: libgthumb/preferences.h
===================================================================
RCS file: /cvs/gnome/gthumb/libgthumb/preferences.h,v
retrieving revision 1.36
diff -u -p -r1.36 preferences.h
--- libgthumb/preferences.h	29 Dec 2005 18:26:37 -0000	1.36
+++ libgthumb/preferences.h	28 Sep 2006 13:26:34 -0000
@@ -43,6 +43,7 @@
 #define  PREF_EDITORS                "/apps/gthumb/general/editors"
 #define  PREF_MIGRATE_DIRECTORIES    "/apps/gthumb/general/migrate_directories"
 #define  PREF_MIGRATE_COMMENT_SYSTEM "/apps/gthumb/general/migrate_comment_system"
+#define  PREF_USE_EXIF_ORIENTATION   "/apps/gthumb/general/use_exif_orientation"
 
 #define  PREF_SHOW_HIDDEN_FILES      "/apps/gthumb/browser/show_hidden_files"
 #define  PREF_SHOW_FILENAMES         "/apps/gthumb/browser/show_filenames"
Index: src/dlg-preferences.c
===================================================================
RCS file: /cvs/gnome/gthumb/src/dlg-preferences.c,v
retrieving revision 1.22
diff -u -p -r1.22 dlg-preferences.c
--- src/dlg-preferences.c	29 Dec 2005 18:26:37 -0000	1.22
+++ src/dlg-preferences.c	28 Sep 2006 13:26:35 -0000
@@ -70,6 +70,8 @@ typedef struct {
 	GtkWidget  *radio_layout3;
 	GtkWidget  *radio_layout4;
 	GtkWidget  *toolbar_style_optionmenu;
+	GtkWidget  *radio_exif_use_orientation_tag;
+	GtkWidget  *radio_exif_use_image_transform;
 
 	GtkWidget  *view_as_slides_radiobutton;
 	GtkWidget  *view_as_list_radiobutton;
@@ -253,6 +255,12 @@ layout_toggled_cb (GtkWidget *widget, 
 	eel_gconf_set_integer (PREF_UI_LAYOUT, layout_type);
 }
 
+static void
+exif_use_orientation_tag_toggled_cb (GtkToggleButton *button, 
+			DialogData      *data)
+{
+	eel_gconf_set_boolean (PREF_USE_EXIF_ORIENTATION, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->radio_exif_use_orientation_tag)));
+}
 
 static void
 toolbar_style_changed_cb (GtkOptionMenu *option_menu,
@@ -447,6 +455,8 @@ dlg_preferences (GthBrowser *browser)
 	data->radio_layout3 = glade_xml_get_widget (data->gui, "radio_layout3");
 	data->radio_layout4 = glade_xml_get_widget (data->gui, "radio_layout4");
 	data->toolbar_style_optionmenu = glade_xml_get_widget (data->gui, "toolbar_style_optionmenu");
+	data->radio_exif_use_orientation_tag = glade_xml_get_widget (data->gui, "radio_exif_use_orientation_tag");
+	data->radio_exif_use_image_transform = glade_xml_get_widget (data->gui, "radio_exif_use_image_transform");
 
 	data->view_as_slides_radiobutton = glade_xml_get_widget (data->gui, "view_as_slides_radiobutton");
 	data->view_as_list_radiobutton = glade_xml_get_widget (data->gui, "view_as_list_radiobutton");
@@ -501,6 +511,11 @@ dlg_preferences (GthBrowser *browser)
 
 	g_free (startup_location);
 
+	if (eel_gconf_get_boolean (PREF_USE_EXIF_ORIENTATION, TRUE))
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->radio_exif_use_orientation_tag), TRUE);
+	else 
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->radio_exif_use_image_transform), TRUE);
+
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->toggle_confirm_del), eel_gconf_get_boolean (PREF_CONFIRM_DELETION, TRUE));
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->toggle_ask_to_save), eel_gconf_get_boolean (PREF_MSG_SAVE_MODIFIED_IMAGE, TRUE));
 
@@ -607,6 +622,15 @@ dlg_preferences (GthBrowser *browser)
 	g_signal_connect (G_OBJECT (data->radio_layout4), 
 			  "toggled",
 			  G_CALLBACK (layout_toggled_cb),
+			  data);
+
+	g_signal_connect (G_OBJECT (data->radio_exif_use_orientation_tag), 
+			  "toggled",
+			  G_CALLBACK (exif_use_orientation_tag_toggled_cb),
+			  data);
+	g_signal_connect (G_OBJECT (data->radio_exif_use_image_transform), 
+			  "toggled",
+			  G_CALLBACK (exif_use_orientation_tag_toggled_cb),
 			  data);
 
 	g_signal_connect (G_OBJECT (data->toolbar_style_optionmenu), 
