* [gentoo-commits] gentoo-x86 commit in sci-libs/gdal/files: gdal-1.11.1-poppler-0.31.0-support.patch
@ 2015-02-24 0:05 Michael Weber (xmw)
0 siblings, 0 replies; only message in thread
From: Michael Weber (xmw) @ 2015-02-24 0:05 UTC (permalink / raw
To: gentoo-commits
xmw 15/02/24 00:05:14
Added: gdal-1.11.1-poppler-0.31.0-support.patch
Log:
Add fix for bug 540132 by Greg Turner.
(Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key 62EEF090)
Revision Changes Path
1.1 sci-libs/gdal/files/gdal-1.11.1-poppler-0.31.0-support.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/gdal/files/gdal-1.11.1-poppler-0.31.0-support.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/gdal/files/gdal-1.11.1-poppler-0.31.0-support.patch?rev=1.1&content-type=text/plain
Index: gdal-1.11.1-poppler-0.31.0-support.patch
===================================================================
diff -urpN gdal-1.11.1.orig/frmts/pdf/pdfdataset.cpp gdal-1.11.1/frmts/pdf/pdfdataset.cpp
--- gdal-1.11.1.orig/frmts/pdf/pdfdataset.cpp 2014-09-24 06:47:43.000000000 -0700
+++ gdal-1.11.1/frmts/pdf/pdfdataset.cpp 2015-02-19 13:55:58.714589328 -0800
@@ -108,12 +108,9 @@ class GDALPDFOutputDev : public SplashOu
public:
GDALPDFOutputDev(SplashColorMode colorModeA, int bitmapRowPadA,
- GBool reverseVideoA, SplashColorPtr paperColorA,
- GBool bitmapTopDownA = gTrue,
- GBool allowAntialiasA = gTrue) :
+ GBool reverseVideoA, SplashColorPtr paperColorA) :
SplashOutputDev(colorModeA, bitmapRowPadA,
- reverseVideoA, paperColorA,
- bitmapTopDownA, allowAntialiasA),
+ reverseVideoA, paperColorA),
bEnableVector(TRUE),
bEnableText(TRUE),
bEnableBitmap(TRUE) {}
diff -urpN gdal-1.11.1.orig/frmts/pdf/pdfio.cpp gdal-1.11.1/frmts/pdf/pdfio.cpp
--- gdal-1.11.1.orig/frmts/pdf/pdfio.cpp 2014-09-24 06:47:43.000000000 -0700
+++ gdal-1.11.1/frmts/pdf/pdfio.cpp 2015-02-19 13:55:58.715589318 -0800
@@ -39,13 +39,25 @@
CPL_CVSID("$Id: gdal-1.11.1-poppler-0.31.0-support.patch,v 1.1 2015/02/24 00:05:14 xmw Exp $");
+
+#ifdef POPPLER_BASE_STREAM_HAS_TWO_ARGS
+/* Poppler 0.31.0 is the first one that needs to know the file size */
+static vsi_l_offset VSIPDFFileStreamGetSize(VSILFILE* f)
+{
+ VSIFSeekL(f, 0, SEEK_END);
+ vsi_l_offset nSize = VSIFTellL(f);
+ VSIFSeekL(f, 0, SEEK_SET);
+ return nSize;
+}
+#endif
+
/************************************************************************/
/* VSIPDFFileStream() */
/************************************************************************/
VSIPDFFileStream::VSIPDFFileStream(VSILFILE* f, const char* pszFilename, Object *dictA):
#ifdef POPPLER_BASE_STREAM_HAS_TWO_ARGS
- BaseStream(dictA, 0)
+ BaseStream(dictA, (setPos_offset_type)VSIPDFFileStreamGetSize(f))
#else
BaseStream(dictA)
#endif
@@ -195,7 +207,7 @@ int VSIPDFFileStream::FillBuffer()
/* getChar() */
/************************************************************************/
-/* The unoptimized version performs a bit well since we must go through */
+/* The unoptimized version performs a bit less since we must go through */
/* the whole virtual I/O chain for each character reading. We save a few */
/* percent with this extra internal caching */
@@ -326,4 +338,47 @@ void VSIPDFFileStream::moveStart(moveSta
nPosInBuffer = nBufferLength = -1;
}
+/************************************************************************/
+/* hasGetChars() */
+/************************************************************************/
+
+GBool VSIPDFFileStream::hasGetChars()
+{
+ return true;
+}
+
+/************************************************************************/
+/* getChars() */
+/************************************************************************/
+
+int VSIPDFFileStream::getChars(int nChars, Guchar *buffer)
+{
+ int nRead = 0;
+ while (nRead < nChars)
+ {
+ int nToRead = nChars - nRead;
+ if (nPosInBuffer == nBufferLength)
+ {
+ if (!bLimited && nToRead > BUFFER_SIZE)
+ {
+ int nJustRead = (int) VSIFReadL(buffer + nRead, 1, nToRead, f);
+ nPosInBuffer = nBufferLength = -1;
+ nCurrentPos += nJustRead;
+ nRead += nJustRead;
+ break;
+ }
+ else if (!FillBuffer() || nPosInBuffer >= nBufferLength)
+ break;
+ }
+ if( nToRead > nBufferLength - nPosInBuffer )
+ nToRead = nBufferLength - nPosInBuffer;
+
+ memcpy( buffer + nRead, abyBuffer + nPosInBuffer, nToRead );
+ nPosInBuffer += nToRead;
+ nCurrentPos += nToRead;
+ nRead += nToRead;
+ }
+ return nRead;
+}
+
#endif
diff -urpN gdal-1.11.1.orig/frmts/pdf/pdfio.h gdal-1.11.1/frmts/pdf/pdfio.h
--- gdal-1.11.1.orig/frmts/pdf/pdfio.h 2014-09-24 06:47:43.000000000 -0700
+++ gdal-1.11.1/frmts/pdf/pdfio.h 2015-02-19 13:55:58.715589318 -0800
@@ -93,6 +93,10 @@ class VSIPDFFileStream: public BaseStrea
virtual void close();
private:
+ /* Added in poppler 0.15.0 */
+ virtual GBool hasGetChars();
+ virtual int getChars(int nChars, Guchar *buffer);
+
VSIPDFFileStream *poParent;
GooString *poFilename;
VSILFILE *f;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-02-24 0:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-24 0:05 [gentoo-commits] gentoo-x86 commit in sci-libs/gdal/files: gdal-1.11.1-poppler-0.31.0-support.patch Michael Weber (xmw)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox