Hello community,

here is the log from the commit of package gdal for openSUSE:Factory checked in 
at 2015-03-29 20:18:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gdal (Old)
 and      /work/SRC/openSUSE:Factory/.gdal.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gdal"

Changes:
--------
--- /work/SRC/openSUSE:Factory/gdal/gdal.changes        2015-03-11 
09:58:56.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.gdal.new/gdal.changes   2015-03-29 
20:18:10.000000000 +0200
@@ -1,0 +2,5 @@
+Fri Mar 27 13:53:57 UTC 2015 - dims...@opensuse.org
+
+- Add gdal-poppler-0.31.patch: Fix build with poppler 0.31+.
+
+-------------------------------------------------------------------

New:
----
  gdal-poppler-0.31.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gdal.spec ++++++
--- /var/tmp/diff_new_pack.PjQ6MZ/_old  2015-03-29 20:18:11.000000000 +0200
+++ /var/tmp/diff_new_pack.PjQ6MZ/_new  2015-03-29 20:18:11.000000000 +0200
@@ -32,6 +32,8 @@
 Patch3:         GDALmake.opt.in.patch
 # Fix hard coded name of libproj library
 Patch4:         gdal-libproj.patch
+# PATCH-FIX-UPSTREAM gdal-poppler-0.31.patch dims...@opensuse.org -- Fix build 
with poppler 0.31+, taken from upstream svn.
+Patch5:         gdal-poppler-0.31.patch
 BuildRequires:  blas-devel
 BuildRequires:  chrpath
 BuildRequires:  curl-devel
@@ -132,6 +134,7 @@
 %patch2 -p1
 %patch3 -p0
 %patch4 -p0
+%patch5 -p0
 
 # need to regenerate (old ones don't support perl 5.10)
 rm swig/perl/{gdal_wrap.cpp,gdalconst_wrap.c,ogr_wrap.cpp,osr_wrap.cpp}

++++++ gdal-poppler-0.31.patch ++++++
Index: frmts/pdf/pdfdataset.cpp
===================================================================
--- frmts/pdf/pdfdataset.cpp.orig
+++ frmts/pdf/pdfdataset.cpp
@@ -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) {}
Index: frmts/pdf/pdfio.cpp
===================================================================
--- frmts/pdf/pdfio.cpp.orig
+++ frmts/pdf/pdfio.cpp
@@ -39,13 +39,25 @@
 
 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 +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
Index: frmts/pdf/pdfio.h
===================================================================
--- frmts/pdf/pdfio.h.orig
+++ frmts/pdf/pdfio.h
@@ -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;
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to