update to 0.16.2

This switches to a new major branch -- many improvements and fixes.
This commit is contained in:
drochner 2011-01-31 16:55:28 +00:00
parent 5823b88a8d
commit 3642649eb7
10 changed files with 16 additions and 274 deletions

View file

@ -1,9 +1,8 @@
# $NetBSD: Makefile,v 1.53 2011/01/13 13:39:14 wiz Exp $
# $NetBSD: Makefile,v 1.54 2011/01/31 16:55:28 drochner Exp $
#
.include "../../print/poppler/Makefile.common"
PKGREVISION= 1
COMMENT= PDF rendering library
MAINTAINER= reed@reedmedia.net

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile.common,v 1.42 2010/11/15 15:13:20 drochner Exp $
# $NetBSD: Makefile.common,v 1.43 2011/01/31 16:55:28 drochner Exp $
#
# used by print/poppler/Makefile
# used by print/poppler-glib/Makefile
@ -7,7 +7,7 @@
# used by print/poppler-qt4/Makefile
# used by print/poppler-utils/Makefile
POPPLER_VERS= 0.14.5
POPPLER_VERS= 0.16.2
DISTNAME= poppler-${POPPLER_VERS}
CATEGORIES= print
MASTER_SITES= http://poppler.freedesktop.org/

View file

@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.22 2010/12/23 11:44:55 dsainty Exp $
# $NetBSD: buildlink3.mk,v 1.23 2011/01/31 16:55:28 drochner Exp $
BUILDLINK_TREE+= poppler
@ -6,7 +6,7 @@ BUILDLINK_TREE+= poppler
POPPLER_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.poppler+= poppler>=0.5.1
BUILDLINK_ABI_DEPENDS.poppler+= poppler>=0.14.2
BUILDLINK_ABI_DEPENDS.poppler+= poppler>=0.16.2
BUILDLINK_PKGSRCDIR.poppler?= ../../print/poppler
pkgbase := poppler

View file

@ -1,17 +1,12 @@
$NetBSD: distinfo,v 1.66 2011/01/24 13:11:20 wiz Exp $
$NetBSD: distinfo,v 1.67 2011/01/31 16:55:28 drochner Exp $
SHA1 (poppler-0.14.5.tar.gz) = e23b115e4ebc06c937318688b06a7c6b3319a00a
RMD160 (poppler-0.14.5.tar.gz) = 80d4441912b02d89777405ce03f8e175c4ccfa9e
Size (poppler-0.14.5.tar.gz) = 1798194 bytes
SHA1 (poppler-0.16.2.tar.gz) = 1d7bcb7aa5601db4526a309da8cadfc12c686788
RMD160 (poppler-0.16.2.tar.gz) = 0344c760f1e0c0f53bdaf88952c4a7280fe0de41
Size (poppler-0.16.2.tar.gz) = 5813608 bytes
SHA1 (patch-aa) = b8c24eb7358410069f7ce6ad62576bc288cd55bb
SHA1 (patch-ab) = 441308aec73c66a34c00ee1fad30a38748c89a7d
SHA1 (patch-ab) = 145cd675a46d56455021660b0a732daf4ec52ec2
SHA1 (patch-ac) = c343775da48a1d86dea1451b74355d117e30f6c5
SHA1 (patch-ad) = f3ca9fbc533330645022937e4b85ebee28ae0629
SHA1 (patch-ag) = 4b914e85bb08ce83305d20de9c0a3e74d3cabdd2
SHA1 (patch-ai) = a51dba3fb0e7131873ef82ae5e256fb1d17cee53
SHA1 (patch-ao) = cf7e0f086522147a91f59b1b26ca510d1971ac74
SHA1 (patch-aq) = 01e115ca868e0bbd398bade92485d83edbe98d66
SHA1 (patch-ar) = 0c77eb223d27545942f2b2d6081f07c3d796bb2d
SHA1 (patch-as) = 9ce48a302cdb83f4dcb811d36a3b23cfb6652bbb
SHA1 (patch-bc) = 456af841d297ce365878c9756d2c6327f9d7658e
SHA1 (patch-bg) = b0353bf4bbee7a85f2a81e346119747897c7289f

View file

@ -1,6 +1,6 @@
$NetBSD: patch-ab,v 1.12 2009/10/21 10:18:57 drochner Exp $
$NetBSD: patch-ab,v 1.13 2011/01/31 16:55:29 drochner Exp $
--- utils/Makefile.in.orig 2009-10-18 01:28:49.000000000 +0200
--- utils/Makefile.in.orig 2011-01-27 19:32:04.000000000 +0000
+++ utils/Makefile.in
@@ -55,7 +55,7 @@ CONFIG_HEADER = $(top_builddir)/config.h
$(top_builddir)/poppler/poppler-config.h
@ -34,7 +34,7 @@ $NetBSD: patch-ab,v 1.12 2009/10/21 10:18:57 drochner Exp $
-pdfinfo_DEPENDENCIES = $(top_builddir)/poppler/libpoppler.la \
+pdfinfo_DEPENDENCIES = $(prefix)/lib/libpoppler.la \
$(am__DEPENDENCIES_1)
am__pdftoabw_SOURCES_DIST = pdftoabw.cc parseargs.c parseargs.h
am__pdftoabw_SOURCES_DIST = pdftoabw.cc parseargs.cc parseargs.h
@BUILD_ABIWORD_OUTPUT_TRUE@am_pdftoabw_OBJECTS = pdftoabw.$(OBJEXT) \
@BUILD_ABIWORD_OUTPUT_TRUE@ $(am__objects_1)
pdftoabw_OBJECTS = $(am_pdftoabw_OBJECTS)
@ -50,7 +50,7 @@ $NetBSD: patch-ab,v 1.12 2009/10/21 10:18:57 drochner Exp $
-pdftohtml_DEPENDENCIES = $(top_builddir)/poppler/libpoppler.la \
+pdftohtml_DEPENDENCIES = $(prefix)/lib/libpoppler.la \
$(am__DEPENDENCIES_1)
am__pdftoppm_SOURCES_DIST = pdftoppm.cc parseargs.c parseargs.h
am__pdftoppm_SOURCES_DIST = pdftoppm.cc parseargs.cc parseargs.h
-@BUILD_SPLASH_OUTPUT_TRUE@am_pdftoppm_OBJECTS = pdftoppm.$(OBJEXT) \
-@BUILD_SPLASH_OUTPUT_TRUE@ $(am__objects_1)
+am_pdftoppm_OBJECTS = pdftoppm.$(OBJEXT) \
@ -75,7 +75,7 @@ $NetBSD: patch-ab,v 1.12 2009/10/21 10:18:57 drochner Exp $
$(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/poppler
depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -366,12 +366,12 @@ top_build_prefix = @top_build_prefix@
@@ -389,12 +389,12 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
win32_libs = @win32_libs@
@ -93,7 +93,7 @@ $NetBSD: patch-ab,v 1.12 2009/10/21 10:18:57 drochner Exp $
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/goo \
@@ -382,9 +382,10 @@ INCLUDES = \
@@ -405,9 +405,10 @@ INCLUDES = \
$(ABIWORD_CFLAGS)
LDADD = \

View file

@ -1,15 +0,0 @@
$NetBSD: patch-ad,v 1.7 2011/01/24 13:11:20 wiz Exp $
Fix build with png-1.5.
https://bugs.freedesktop.org/show_bug.cgi?id=33405
--- goo/PNGWriter.cc.orig 2010-06-08 20:06:31.000000000 +0000
+++ goo/PNGWriter.cc
@@ -15,6 +15,7 @@
#include "PNGWriter.h"
#ifdef ENABLE_LIBPNG
+#include <zlib.h>
#include "poppler/Error.h"

View file

@ -1,66 +0,0 @@
$NetBSD: patch-ar,v 1.1 2011/01/11 12:17:15 drochner Exp $
--- poppler/CairoOutputDev.cc.orig 2010-11-02 19:20:36.000000000 +0000
+++ poppler/CairoOutputDev.cc
@@ -2286,6 +2286,36 @@ GBool CairoOutputDev::getStreamData (Str
return gTrue;
}
+void CairoOutputDev::setMimeData(Stream *str, cairo_surface_t *image)
+{
+ char *strBuffer;
+ int len;
+ Object obj;
+
+ if (!printing || !(str->getKind() == strDCT || str->getKind() == strJPX))
+ return;
+
+ // colorspace in stream dict may be different from colorspace in jpx
+ // data
+ if (str->getKind() == strJPX) {
+ GBool hasColorSpace = !str->getDict()->lookup("ColorSpace", &obj)->isNull();
+ obj.free();
+ if (hasColorSpace)
+ return;
+ }
+
+ if (getStreamData (str->getNextStream(), &strBuffer, &len)) {
+ cairo_status_t st;
+ st = cairo_surface_set_mime_data (image,
+ str->getKind() == strDCT ?
+ CAIRO_MIME_TYPE_JPEG : CAIRO_MIME_TYPE_JP2,
+ (const unsigned char *)strBuffer, len,
+ gfree, strBuffer);
+ if (st)
+ gfree (strBuffer);
+ }
+}
+
void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
@@ -2399,23 +2429,7 @@ void CairoOutputDev::drawImage(GfxState
cairo_surface_mark_dirty (image);
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 9, 6)
- if (printing && (str->getKind() == strDCT || str->getKind() == strJPX)) {
- char *strBuffer;
- int len;
-
- if (getStreamData (str->getNextStream(), &strBuffer, &len)) {
- cairo_status_t st;
- st = cairo_surface_set_mime_data (image,
- str->getKind() == strDCT ?
- CAIRO_MIME_TYPE_JPEG : CAIRO_MIME_TYPE_JP2,
- (const unsigned char *)strBuffer, len,
- gfree, strBuffer);
- if (st)
- gfree (strBuffer);
- }
- }
-#endif /* CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 9, 6) */
+ setMimeData(str, image);
pattern = cairo_pattern_create_for_surface (image);
cairo_surface_destroy (image);

View file

@ -1,12 +0,0 @@
$NetBSD: patch-as,v 1.1 2011/01/11 12:17:15 drochner Exp $
--- poppler/CairoOutputDev.h.orig 2010-11-02 19:20:36.000000000 +0000
+++ poppler/CairoOutputDev.h
@@ -275,6 +275,7 @@ protected:
cairo_filter_t getFilterForSurface(cairo_surface_t *image,
GBool interpolate);
GBool getStreamData (Stream *str, char **buffer, int *length);
+ void setMimeData(Stream *str, cairo_surface_t *image);
GfxRGB fill_color, stroke_color;
cairo_pattern_t *fill_pattern, *stroke_pattern;

View file

@ -1,92 +0,0 @@
$NetBSD: patch-bc,v 1.3 2010/10/01 21:32:34 spz Exp $
security fixes for http://secunia.com/advisories/41596/
taken from http://cgit.freedesktop.org/poppler
- Fix memory leak
--- poppler/Stream.cc.orig 2010-06-08 20:06:31.000000000 +0000
+++ poppler/Stream.cc
@@ -99,6 +99,10 @@ int Stream::getRawChar() {
return EOF;
}
+void Stream::getRawChars(int nChars, int *buffer) {
+ error(-1, "Internal: called getRawChars() on non-predictor stream");
+}
+
char *Stream::getLine(char *buf, int size) {
int i;
int c;
@@ -571,19 +575,22 @@ GBool StreamPredictor::getNextLine() {
}
// read the raw line, apply PNG (byte) predictor
+ int *rawCharLine = new int[rowBytes - pixBytes];
+ str->getRawChars(rowBytes - pixBytes, rawCharLine);
memset(upLeftBuf, 0, pixBytes + 1);
for (i = pixBytes; i < rowBytes; ++i) {
for (j = pixBytes; j > 0; --j) {
upLeftBuf[j] = upLeftBuf[j-1];
}
upLeftBuf[0] = predLine[i];
- if ((c = str->getRawChar()) == EOF) {
+ if ((c = rawCharLine[i - pixBytes]) == EOF) {
if (i > pixBytes) {
// this ought to return false, but some (broken) PDF files
// contain truncated image data, and Adobe apparently reads the
// last partial line
break;
}
+ delete[] rawCharLine;
return gFalse;
}
switch (curPred) {
@@ -1237,16 +1244,13 @@ int LZWStream::lookChar() {
return seqBuf[seqIndex];
}
+void LZWStream::getRawChars(int nChars, int *buffer) {
+ for (int i = 0; i < nChars; ++i)
+ buffer[i] = doGetRawChar();
+}
+
int LZWStream::getRawChar() {
- if (eof) {
- return EOF;
- }
- if (seqIndex >= seqLength) {
- if (!processNextCode()) {
- return EOF;
- }
- }
- return seqBuf[seqIndex++];
+ return doGetRawChar();
}
void LZWStream::reset() {
@@ -4262,18 +4266,13 @@ int FlateStream::lookChar() {
return c;
}
-int FlateStream::getRawChar() {
- int c;
+void FlateStream::getRawChars(int nChars, int *buffer) {
+ for (int i = 0; i < nChars; ++i)
+ buffer[i] = doGetRawChar();
+}
- while (remain == 0) {
- if (endOfBlock && eof)
- return EOF;
- readSome();
- }
- c = buf[index];
- index = (index + 1) & flateMask;
- --remain;
- return c;
+int FlateStream::getRawChar() {
+ return doGetRawChar();
}
GooString *FlateStream::getPSFilter(int psLevel, char *indent) {

View file

@ -1,67 +0,0 @@
$NetBSD: patch-bg,v 1.1 2010/10/01 21:32:34 spz Exp $
backport of changes necessary to apply the
security fixes for http://secunia.com/advisories/41596/
taken from http://cgit.freedesktop.org/poppler
--- poppler/Stream.h.orig 2010-06-08 20:06:31.000000000 +0000
+++ poppler/Stream.h
@@ -115,6 +115,7 @@ public:
// Get next char from stream without using the predictor.
// This is only used by StreamPredictor.
virtual int getRawChar();
+ virtual void getRawChars(int nChars, int *buffer);
// Get next char directly from stream source, without filtering it
virtual int getUnfilteredChar () = 0;
@@ -596,11 +597,24 @@ public:
virtual int getChar();
virtual int lookChar();
virtual int getRawChar();
+ virtual void getRawChars(int nChars, int *buffer);
virtual GooString *getPSFilter(int psLevel, char *indent);
virtual GBool isBinary(GBool last = gTrue);
private:
+ inline int doGetRawChar() {
+ if (eof) {
+ return EOF;
+ }
+ if (seqIndex >= seqLength) {
+ if (!processNextCode()) {
+ return EOF;
+ }
+ }
+ return seqBuf[seqIndex++];
+ }
+
StreamPredictor *pred; // predictor
int early; // early parameter
GBool eof; // true if at eof
@@ -855,11 +869,25 @@ public:
virtual int getChar();
virtual int lookChar();
virtual int getRawChar();
+ virtual void getRawChars(int nChars, int *buffer);
virtual GooString *getPSFilter(int psLevel, char *indent);
virtual GBool isBinary(GBool last = gTrue);
virtual void unfilteredReset ();
private:
+ inline int doGetRawChar() {
+ int c;
+
+ while (remain == 0) {
+ if (endOfBlock && eof)
+ return EOF;
+ readSome();
+ }
+ c = buf[index];
+ index = (index + 1) & flateMask;
+ --remain;
+ return c;
+ }
StreamPredictor *pred; // predictor
Guchar buf[flateWindow]; // output data buffer