[gthumb] take the initial tag into account when doing a lossless rotation



commit e854e3dd5244475a78c66ca78cda271f98463dc5
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Jun 22 11:37:00 2010 +0200

    take the initial tag into account when doing a lossless rotation

 extensions/image_rotation/rotation-utils.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/extensions/image_rotation/rotation-utils.c b/extensions/image_rotation/rotation-utils.c
index 119e85b..0459c58 100644
--- a/extensions/image_rotation/rotation-utils.c
+++ b/extensions/image_rotation/rotation-utils.c
@@ -273,14 +273,21 @@ file_buffer_ready_cb (void     **buffer,
 
 #ifdef HAVE_LIBJPEG
 	if (g_content_type_equals (gth_file_data_get_mime_type (tdata->file_data), "image/jpeg")) {
-		void  *out_buffer;
-		gsize  out_buffer_size;
+		GthMetadata  *metadata;
+		GthTransform  current_orientation;
+		void         *out_buffer;
+		gsize         out_buffer_size;
+
+		current_orientation = 1;
+		metadata = (GthMetadata *) g_file_info_get_attribute_object (tdata->file_data->info, "Embedded::Image::Orientation");
+		if ((metadata != NULL) && (gth_metadata_get_raw (metadata) != NULL))
+			current_orientation = strtol (gth_metadata_get_raw (metadata), (char **) NULL, 10);
 
 		if (! jpegtran (*buffer,
 				count,
 				&out_buffer,
 				&out_buffer_size,
-				tdata->transform,
+				get_next_transformation (current_orientation, tdata->transform),
 				tdata->mcu_action,
 				&error))
 		{



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]