[epdfview] Apply a patch from SVN to fix colors of pictures with poppler 0.18.
Michal Schmidt
michich at fedoraproject.org
Wed Oct 19 09:34:17 UTC 2011
commit 3ecd35a265b7fa70274428e51445e4cedceb3cd2
Author: Michal Schmidt <mschmidt at redhat.com>
Date: Wed Oct 19 11:32:18 2011 +0200
Apply a patch from SVN to fix colors of pictures with poppler 0.18.
Fixes: BZ#745483
epdfview-0.1.8-swap-colors-with-poppler-0.18.patch | 50 ++++++++++++++++++++
epdfview.spec | 8 +++-
2 files changed, 57 insertions(+), 1 deletions(-)
---
diff --git a/epdfview-0.1.8-swap-colors-with-poppler-0.18.patch b/epdfview-0.1.8-swap-colors-with-poppler-0.18.patch
new file mode 100644
index 0000000..ee73d86
--- /dev/null
+++ b/epdfview-0.1.8-swap-colors-with-poppler-0.18.patch
@@ -0,0 +1,50 @@
+Swap color channels to fix pictures with poppler 0.18
+
+Upstream: http://trac.emma-soft.com/epdfview/changeset/367/trunk
+Fixes bug: https://bugzilla.redhat.com/show_bug.cgi?id=745483
+
+Index: src/PDFDocument.cxx
+===================================================================
+--- src/PDFDocument.cxx (revision 366)
++++ src/PDFDocument.cxx (revision 367)
+@@ -20,6 +20,7 @@
+ #include <time.h>
+ #include <poppler.h>
+ #include <unistd.h>
++#include <algorithm>
+ #include "epdfview.h"
+
+ using namespace ePDFView;
+@@ -33,6 +34,24 @@
+ static PageMode convertPageMode (gint pageMode);
+ static gchar *getAbsoluteFileName (const gchar *fileName);
+
++namespace
++{
++ void
++ convert_bgra_to_rgba (guint8 *data, int width, int height)
++ {
++ using std::swap;
++
++ for (int y = 0; y < height; y++)
++ {
++ for (int x = 0; x < width; x++)
++ {
++ swap(data[0], data[2]);
++ data += 4;
++ }
++ }
++ }
++}
++
+ ///
+ /// @brief Constructs a new PDFDocument object.
+ ///
+@@ -650,6 +669,7 @@
+ poppler_page_render (page, context);
+ cairo_destroy(context);
+ cairo_surface_destroy (surface);
++ convert_bgra_to_rgba(renderedPage->getData (), width, height);
+ #else // !HAVE_POPPLER_0_17_0
+ // Create the pixbuf from the data and render to it.
+ GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data (renderedPage->getData (),
diff --git a/epdfview.spec b/epdfview.spec
index 571405c..5a8ef29 100644
--- a/epdfview.spec
+++ b/epdfview.spec
@@ -1,12 +1,13 @@
Name: epdfview
Version: 0.1.8
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Lightweight PDF document viewer
Group: Applications/Publishing
License: GPLv2+
URL: http://trac.emma-soft.com/epdfview
Source0: http://trac.emma-soft.com/epdfview/chrome/site/releases/%{name}-%{version}.tar.bz2
+Patch0: epdfview-0.1.8-swap-colors-with-poppler-0.18.patch
BuildRequires: poppler-glib-devel
BuildRequires: gtk2-devel glib2-devel cups-devel
@@ -20,6 +21,7 @@ Evince but without using the Gnome libraries.
%prep
%setup -q
+%patch0 -p0
%build
%configure
@@ -61,6 +63,10 @@ update-desktop-database &> /dev/null || :
%{_mandir}/man*/*
%changelog
+* Wed Oct 19 2011 Michal Schmidt <mschmidt at redhat.com> - 0.1.8-5
+- Apply a patch from SVN to fix colors of pictures with poppler 0.18.
+- Fixes: BZ#745483
+
* Fri Sep 30 2011 Marek Kasik <mkasik at redhat.com> - 0.1.8-4
- Rebuild (poppler-0.18.0)
More information about the scm-commits
mailing list