ports/162266: [PATCH] graphics/epdfview: fix wrong color
Anati Chang
femc7488 at gmail.com
Thu Nov 3 08:00:24 UTC 2011
>Number: 162266
>Category: ports
>Synopsis: [PATCH] graphics/epdfview: fix wrong color
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Thu Nov 03 08:00:20 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: User &
>Release: FreeBSD 8.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD cse.tw 8.2-STABLE FreeBSD 8.2-STABLE #6: Wed Oct 5 11:51:25 CST 2011 gaod at cse.tw:/usr/obj/usr/src/sys/GENERIC i386
>Description:
PDF document will get wrong color, when poppler-glib update to 0.18.0.
apply this thread http://trac.emma-soft.com/epdfview/changeset/367
>How-To-Repeat:
apply this patch
>Fix:
--- epdfview.patch begins here ---
===> Generating patch
===> Viewing diff with more
diff -ruN --exclude=CVS /usr/ports/graphics/epdfview.orig/Makefile /usr/ports/graphics/epdfview/Makefile
--- /usr/ports/graphics/epdfview.orig/Makefile 2011-11-03 13:29:10.000000000 +0800
+++ /usr/ports/graphics/epdfview/Makefile 2011-11-03 14:50:14.000000000 +0800
@@ -7,7 +7,7 @@
PORTNAME= epdfview
PORTVERSION= 0.1.8
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= graphics print gnome
MASTER_SITES= http://trac.emma-soft.com/epdfview/chrome/site/releases/ \
http://mirror.slitaz.org/sources/packages/e/
@@ -15,11 +15,11 @@
MAINTAINER= sylvio at FreeBSD.org
COMMENT= A lightweight PDF document viewer
+LICENSE= GPLv2
+
BUILD_DEPENDS= cppunit-config:${PORTSDIR}/devel/cppunit
LIB_DEPENDS= poppler-glib.8:${PORTSDIR}/graphics/poppler-glib
-LICENSE= GPLv2
-
USE_BZIP2= yes
GNU_CONFIGURE= yes
INSTALLS_ICONS= yes
diff -ruN --exclude=CVS /usr/ports/graphics/epdfview.orig/files/patch-PDFDocument.cxx /usr/ports/graphics/epdfview/files/patch-PDFDocument.cxx
--- /usr/ports/graphics/epdfview.orig/files/patch-PDFDocument.cxx 1970-01-01 08:00:00.000000000 +0800
+++ /usr/ports/graphics/epdfview/files/patch-PDFDocument.cxx 2011-11-03 13:46:41.000000000 +0800
@@ -0,0 +1,42 @@
+--- src/PDFDocument.cxx.orig 2011-05-28 18:25:01.000000000 +0800
++++ src/PDFDocument.cxx 2011-11-03 13:42:30.000000000 +0800
+@@ -20,6 +20,7 @@
+ #include <time.h>
+ #include <poppler.h>
+ #include <unistd.h>
++#include <algorithm>
+ #include "epdfview.h"
+
+ using namespace ePDFView;
+@@ -33,6 +34,23 @@
+ 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 +668,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 (),
===> Done
--- epdfview.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list