Index: src/dlg-jpegtran.c
===================================================================
RCS file: /cvs/gnome/gthumb/src/dlg-jpegtran.c,v
retrieving revision 1.36
diff -u -p -r1.36 dlg-jpegtran.c
--- src/dlg-jpegtran.c	22 Jan 2006 11:46:08 -0000	1.36
+++ src/dlg-jpegtran.c	2 Oct 2006 13:45:25 -0000
@@ -326,7 +326,10 @@ apply_transformation (DialogData *data,
 		update_rotation_from_exif_data (path, data->rot_data);
 	gnome_vfs_get_file_info (path, &info, GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS|GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
 	if (image_is_jpeg (path)) 
-		apply_transformation_jpeg (window, path, data->rot_data);
+		if (eel_gconf_get_boolean (PREF_USE_EXIF_ORIENTATION, TRUE))
+			apply_transformation_exif (window, path, data->rot_data);
+		else
+			apply_transformation_jpeg (window, path, data->rot_data);
 	else 
 		apply_transformation_generic (window, path, data->rot_data);
 	gnome_vfs_set_file_info (path, &info, GNOME_VFS_SET_FILE_INFO_PERMISSIONS|GNOME_VFS_SET_FILE_INFO_OWNER);
Index: src/rotation-utils.c
===================================================================
RCS file: /cvs/gnome/gthumb/src/rotation-utils.c,v
retrieving revision 1.6
diff -u -p -r1.6 rotation-utils.c
--- src/rotation-utils.c	5 Mar 2006 11:52:59 -0000	1.6
+++ src/rotation-utils.c	2 Oct 2006 13:45:46 -0000
@@ -107,6 +107,22 @@ update_rotation_from_exif_data (const ch
 #endif /* HAVE_LIBEXIF */
 }
 
+void
+apply_transformation_exif (GtkWindow    *win,
+			   const char   *path,
+			   RotationData *rot_data)
+
+{
+#ifdef HAVE_LIBEXIF
+	if (get_exif_tag_short(path,EXIF_TAG_ORIENTATION)) {
+		update_orientation_field (path, rot_data);
+	} else {
+		apply_transformation_jpeg(win, path, rot_data);
+	}
+#else
+	apply_transformation_jpeg(win, path, rot_data);
+#endif
+}
 
 void
 apply_transformation_jpeg (GtkWindow    *win,
Index: src/rotation-utils.h
===================================================================
RCS file: /cvs/gnome/gthumb/src/rotation-utils.h,v
retrieving revision 1.2
diff -u -p -r1.2 rotation-utils.h
--- src/rotation-utils.h	24 Dec 2005 13:08:28 -0000	1.2
+++ src/rotation-utils.h	2 Oct 2006 13:45:46 -0000
@@ -41,6 +41,9 @@ RotationData*	        rotation_data_new 
 
 void			update_rotation_from_exif_data (const char      *filename,
 							RotationData 	*rot_data);
+void			apply_transformation_exif      (GtkWindow       *win,
+							const char      *filename,
+							RotationData 	*rot_data);
 void			apply_transformation_jpeg      (GtkWindow       *win,
 							const char      *filename,
 							RotationData 	*rot_data);
