evince r3110 - in trunk: . backend/tiff



Author: carlosgc
Date: Tue Aug 19 16:05:20 2008
New Revision: 3110
URL: http://svn.gnome.org/viewvc/evince?rev=3110&view=rev

Log:
2008-08-19  Carlos Garcia Campos  <carlosgc gnome org>

	* backend/tiff/tiff-document.c: (tiff_document_render):

	Handle document orientation in tiff backend. Fixes bug #548444.


Modified:
   trunk/ChangeLog
   trunk/backend/tiff/tiff-document.c

Modified: trunk/backend/tiff/tiff-document.c
==============================================================================
--- trunk/backend/tiff/tiff-document.c	(original)
+++ trunk/backend/tiff/tiff-document.c	Tue Aug 19 16:05:20 2008
@@ -215,6 +215,7 @@
 	gint rowstride, bytes;
 	guchar *pixels = NULL;
 	guchar *p;
+	int orientation;
 	cairo_surface_t *surface;
 	cairo_surface_t *rotated_surface;
 	static const cairo_user_data_key_t key;
@@ -238,6 +239,10 @@
 		return NULL;
 	}
 
+	if (! TIFFGetField (tiff_document->tiff, TIFFTAG_ORIENTATION, &orientation)) {
+		orientation = ORIENTATION_TOPLEFT;
+	}
+
 	tiff_document_get_resolution (tiff_document, &x_res, &y_res);
 	
 	pop_handlers ();
@@ -274,7 +279,7 @@
 	TIFFReadRGBAImageOriented (tiff_document->tiff,
 				   width, height,
 				   (uint32 *)pixels,
-				   ORIENTATION_TOPLEFT, 1);
+				   orientation, 1);
 	pop_handlers ();
 
 	/* Convert the format returned by libtiff to



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