Attached is a update to epdfview to fix an issue where blues and reds
are switched. Patch taken from [0]. Even though we are running a newer
version of poppler the issue still seems to exist.

Tested on i386. Thanks.

[0] http://trac.emma-soft.com/epdfview/changeset/367

-- 
James Turner
ja...@calminferno.net
Index: Makefile
===================================================================
RCS file: /cvs/ports/print/epdfview/Makefile,v
retrieving revision 1.25
diff -N -u -p Makefile
--- Makefile    3 Dec 2011 23:04:37 -0000       1.25
+++ Makefile    13 Jan 2012 03:11:03 -0000
@@ -3,7 +3,7 @@
 COMMENT=       lightweight PDF document viewer
 
 DISTNAME=      epdfview-0.1.8
-REVISION=      1
+REVISION=      2
 CATEGORIES=    print
 HOMEPAGE=      http://trac.emma-soft.com/epdfview/
 
Index: patches/patch-src_PDFDocument_cxx
===================================================================
RCS file: /cvs/ports/print/epdfview/patches/Attic/patch-src_PDFDocument_cxx,v
diff -N -u -p patches/patch-src_PDFDocument_cxx
--- /dev/null   12 Jan 2012 20:11:03 -0000
+++ patches/patch-src_PDFDocument_cxx   13 Jan 2012 03:11:03 -0000
@@ -0,0 +1,44 @@
+$OpenBSD$
+--- src/PDFDocument.cxx.orig   Sat May 28 06:25:01 2011
++++ src/PDFDocument.cxx        Thu Jan 12 22:08:15 2012
+@@ -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 PageLayout convertPageLayout (gint pageLayout);
+ 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 @@ PDFDocument::renderPage (gint pageNum)
+         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 
(),

Reply via email to