diff --git a/gdal-svn28438-poppler31.diff b/gdal-svn28438-poppler31.diff new file mode 100644 index 0000000..48cae1f --- /dev/null +++ b/gdal-svn28438-poppler31.diff @@ -0,0 +1,118 @@ +diff -up gdal-1.11.2-fedora/frmts/pdf/pdfdataset.cpp.poppler31~ gdal-1.11.2-fedora/frmts/pdf/pdfdataset.cpp +--- gdal-1.11.2-fedora/frmts/pdf/pdfdataset.cpp.poppler31~ 2015-02-10 13:11:19.000000000 +0100 ++++ gdal-1.11.2-fedora/frmts/pdf/pdfdataset.cpp 2015-06-09 21:39:32.000000000 +0200 +@@ -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 -up gdal-1.11.2-fedora/frmts/pdf/pdfio.cpp.poppler31~ gdal-1.11.2-fedora/frmts/pdf/pdfio.cpp +--- gdal-1.11.2-fedora/frmts/pdf/pdfio.cpp.poppler31~ 2015-02-10 13:11:19.000000000 +0100 ++++ gdal-1.11.2-fedora/frmts/pdf/pdfio.cpp 2015-06-09 21:41:18.000000000 +0200 +@@ -39,13 +39,24 @@ + + CPL_CVSID("$Id: pdfio.cpp 27044 2014-03-16 23:41:27Z rouault $"); + ++#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 +206,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 +337,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 -up gdal-1.11.2-fedora/frmts/pdf/pdfio.h.poppler31~ gdal-1.11.2-fedora/frmts/pdf/pdfio.h +--- gdal-1.11.2-fedora/frmts/pdf/pdfio.h.poppler31~ 2015-02-10 13:11:19.000000000 +0100 ++++ gdal-1.11.2-fedora/frmts/pdf/pdfio.h 2015-06-09 21:39:48.000000000 +0200 +@@ -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; diff --git a/gdal.spec b/gdal.spec index 90fc887..dc90962 100644 --- a/gdal.spec +++ b/gdal.spec @@ -43,7 +43,7 @@ Name: gdal Version: 1.11.2 -Release: 7%{?dist} +Release: 8%{?dist} Summary: GIS file format library Group: System Environment/Libraries License: MIT @@ -68,6 +68,10 @@ Patch2: %{name}-jni.patch # Fedora uses Alternatives for Java Patch8: %{name}-1.9.0-java.patch +# update for poppler >= 31 +# http://trac.osgeo.org/gdal/changeset/28438/ +Patch9: %{name}-svn28438-poppler31.diff + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: ant @@ -275,6 +279,7 @@ rm -r frmts/grib/degrib18/g2clib-1.0.4 %patch1 -p1 -b .g2clib~ %patch2 -p1 -b .jni~ %patch8 -p1 -b .java~ +%patch9 -p1 -b .poppler31~ # Copy in PROVENANCE.TXT-fedora cp -p %SOURCE4 . @@ -773,6 +778,9 @@ popd #Or as before, using ldconfig %changelog +* Tue Jun 09 2015 Dan HorĂ¡k - 1.11.2-8 +- add upstream patch for poppler >= 31 + * Sat Jun 06 2015 Jitka Plesnikova - 1.11.2-7 - Perl 5.22 rebuild