Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 540132
Collapse All | Expand All

(-)gdal-1.11.1.orig/frmts/pdf/pdfdataset.cpp (-5 / +2 lines)
Lines 108-119 class GDALPDFOutputDev : public SplashOu Link Here
108
108
109
    public:
109
    public:
110
        GDALPDFOutputDev(SplashColorMode colorModeA, int bitmapRowPadA,
110
        GDALPDFOutputDev(SplashColorMode colorModeA, int bitmapRowPadA,
111
                         GBool reverseVideoA, SplashColorPtr paperColorA,
111
                         GBool reverseVideoA, SplashColorPtr paperColorA) :
112
                         GBool bitmapTopDownA = gTrue,
113
                         GBool allowAntialiasA = gTrue) :
114
                SplashOutputDev(colorModeA, bitmapRowPadA,
112
                SplashOutputDev(colorModeA, bitmapRowPadA,
115
                                reverseVideoA, paperColorA,
113
                                reverseVideoA, paperColorA),
116
                                bitmapTopDownA, allowAntialiasA),
117
                bEnableVector(TRUE),
114
                bEnableVector(TRUE),
118
                bEnableText(TRUE),
115
                bEnableText(TRUE),
119
                bEnableBitmap(TRUE) {}
116
                bEnableBitmap(TRUE) {}
(-)gdal-1.11.1.orig/frmts/pdf/pdfio.cpp (-2 / +57 lines)
Lines 39-51 Link Here
39
39
40
CPL_CVSID("$Id: pdfio.cpp 27044 2014-03-16 23:41:27Z rouault $");
40
CPL_CVSID("$Id: pdfio.cpp 27044 2014-03-16 23:41:27Z rouault $");
41
41
42
43
#ifdef POPPLER_BASE_STREAM_HAS_TWO_ARGS
44
/* Poppler 0.31.0 is the first one that needs to know the file size */
45
static vsi_l_offset VSIPDFFileStreamGetSize(VSILFILE* f)
46
{
47
    VSIFSeekL(f, 0, SEEK_END);
48
    vsi_l_offset nSize = VSIFTellL(f);
49
    VSIFSeekL(f, 0, SEEK_SET);
50
    return nSize;
51
}
52
#endif
53
42
/************************************************************************/
54
/************************************************************************/
43
/*                         VSIPDFFileStream()                           */
55
/*                         VSIPDFFileStream()                           */
44
/************************************************************************/
56
/************************************************************************/
45
57
46
VSIPDFFileStream::VSIPDFFileStream(VSILFILE* f, const char* pszFilename, Object *dictA):
58
VSIPDFFileStream::VSIPDFFileStream(VSILFILE* f, const char* pszFilename, Object *dictA):
47
#ifdef POPPLER_BASE_STREAM_HAS_TWO_ARGS
59
#ifdef POPPLER_BASE_STREAM_HAS_TWO_ARGS
48
                                                        BaseStream(dictA, 0)
60
                                                        BaseStream(dictA, (setPos_offset_type)VSIPDFFileStreamGetSize(f))
49
#else
61
#else
50
                                                        BaseStream(dictA)
62
                                                        BaseStream(dictA)
51
#endif
63
#endif
Lines 195-201 int VSIPDFFileStream::FillBuffer() Link Here
195
/*                                getChar()                             */
207
/*                                getChar()                             */
196
/************************************************************************/
208
/************************************************************************/
197
209
198
/* The unoptimized version performs a bit well since we must go through */
210
/* The unoptimized version performs a bit less since we must go through */
199
/* the whole virtual I/O chain for each character reading. We save a few */
211
/* the whole virtual I/O chain for each character reading. We save a few */
200
/* percent with this extra internal caching */
212
/* percent with this extra internal caching */
201
213
Lines 326-329 void VSIPDFFileStream::moveStart(moveSta Link Here
326
    nPosInBuffer = nBufferLength = -1;
338
    nPosInBuffer = nBufferLength = -1;
327
}
339
}
328
340
341
/************************************************************************/
342
/*                          hasGetChars()                               */
343
/************************************************************************/
344
345
GBool VSIPDFFileStream::hasGetChars()
346
{
347
    return true;
348
}
349
350
/************************************************************************/
351
/*                            getChars()                                */
352
/************************************************************************/
353
354
int VSIPDFFileStream::getChars(int nChars, Guchar *buffer)
355
{
356
    int nRead = 0;
357
    while (nRead < nChars)
358
    {
359
        int nToRead = nChars - nRead;
360
        if (nPosInBuffer == nBufferLength)
361
        {
362
            if (!bLimited && nToRead > BUFFER_SIZE)
363
            {
364
                int nJustRead = (int) VSIFReadL(buffer + nRead, 1, nToRead, f);
365
                nPosInBuffer = nBufferLength = -1;
366
                nCurrentPos += nJustRead;
367
                nRead += nJustRead;
368
                break;
369
            }
370
            else if (!FillBuffer() || nPosInBuffer >= nBufferLength)
371
                break;
372
        }
373
        if( nToRead > nBufferLength - nPosInBuffer )
374
            nToRead = nBufferLength - nPosInBuffer;
375
376
        memcpy( buffer + nRead, abyBuffer + nPosInBuffer, nToRead );
377
        nPosInBuffer += nToRead;
378
        nCurrentPos += nToRead;
379
        nRead += nToRead;
380
    }
381
    return nRead;
382
}
383
329
#endif
384
#endif
(-)gdal-1.11.1.orig/frmts/pdf/pdfio.h (+4 lines)
Lines 93-98 class VSIPDFFileStream: public BaseStrea Link Here
93
        virtual void       close();
93
        virtual void       close();
94
94
95
    private:
95
    private:
96
        /* Added in poppler 0.15.0 */
97
        virtual GBool hasGetChars();
98
        virtual int getChars(int nChars, Guchar *buffer);
99
96
        VSIPDFFileStream  *poParent;
100
        VSIPDFFileStream  *poParent;
97
        GooString         *poFilename;
101
        GooString         *poFilename;
98
        VSILFILE          *f;
102
        VSILFILE          *f;

Return to bug 540132