From 499c2ddc2c255c33cb127087e7328c63c62345d9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 16 Nov 2007 04:06:24 +0000 Subject: [PATCH] Fix rendering of tiffs --- evince.spec | 8 +++++++- tiff.patch | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 tiff.patch diff --git a/evince.spec b/evince.spec index 3a3f7a9..061638b 100644 --- a/evince.spec +++ b/evince.spec @@ -5,7 +5,7 @@ Name: evince Version: 2.20.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Document viewer License: GPLv2+ and GFDL+ @@ -13,6 +13,8 @@ Group: Applications/Publishing URL: http://www.gnome.org/projects/evince/ Source0: http://download.gnome.org/sources/%{name}/2.20/%{name}-%{version}.tar.bz2 Patch0: evince-0.6.0-print-error.patch +# http://bugzilla.gnome.org/show_bug.cgi?id=497279 +Patch1: tiff.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gtk2-devel >= %{gtk2_version} @@ -50,6 +52,7 @@ evince is a GNOME-based document viewer. %prep %setup -q %patch0 -p1 -b .print-error +%patch1 -p1 -b .tiff %build intltoolize --force @@ -151,6 +154,9 @@ fi %changelog +* Thu Nov 15 2007 Matthias Clasen - 2.20.1-3 +- Fix rendering of tiff images (#385671) + * Tue Oct 23 2007 Matthias Clasen - 2.20.1-2 - Rebuild against new dbus-glib diff --git a/tiff.patch b/tiff.patch new file mode 100644 index 0000000..e56185b --- /dev/null +++ b/tiff.patch @@ -0,0 +1,33 @@ +diff -up evince-2.20.1/backend/tiff/tiff-document.c.tiff evince-2.20.1/backend/tiff/tiff-document.c +--- evince-2.20.1/backend/tiff/tiff-document.c.tiff 2007-10-15 16:12:12.000000000 -0400 ++++ evince-2.20.1/backend/tiff/tiff-document.c 2007-11-15 23:02:08.000000000 -0500 +@@ -210,6 +210,7 @@ tiff_document_render (EvDocument *d + float x_res, y_res; + gint rowstride, bytes; + guchar *pixels = NULL; ++ guchar *p; + GdkPixbuf *pixbuf; + GdkPixbuf *scaled_pixbuf; + GdkPixbuf *rotated_pixbuf; +@@ -271,6 +272,21 @@ tiff_document_render (EvDocument *d + ORIENTATION_TOPLEFT, 1); + pop_handlers (); + ++ /* Convert the format returned by libtiff to ++ * what cairo expects ++ */ ++ while (p < pixels + bytes) { ++ uint32 pixel = *(uint32 *)p; ++ int r = TIFFGetR(pixel); ++ int g = TIFFGetG(pixel); ++ int b = TIFFGetB(pixel); ++ int a = TIFFGetA(pixel); ++ *p++ = b; ++ *p++ = g; ++ *p++ = r; ++ *p++ = a; ++ } ++ + rotated_surface = ev_document_misc_surface_rotate_and_scale (surface, + (width * rc->scale) + 0.5, + (height * rc->scale * (x_res / y_res)) + 0.5,