https://bugs.documentfoundation.org/show_bug.cgi?id=113050

--- Comment #19 from Dave Gilbert <freedesk...@treblig.org> ---
OK, so now I understand the source of the problem.
On Page 17 of the presentation is a cut-art graphic of a hand; this hand has a
few half-toned patterns on it;  these are represented in the pdf as images and
masks (about 8 of them).  They're then repeated using a tiled pattern fill; and
poppler calls us back for every repetition creating thousands of copies.
(That minimum test case has part of that pattern in it)

#0  pdfi::PDFOutDev::drawImageMask (this=0x7fffffffdc20, pState=0x78c080,
str=0x794910, width=8, height=8, invert=false)
    at
/discs/fast/core/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:1031
#1  0x0000000000484b32 in Gfx::doImage (this=this@entry=0x760540,
ref=ref@entry=0x7fffffffcef0, str=0x794910, inlineImg=inlineImg@entry=false)
    at /discs/fast/core/workdir/UnpackedTarball/poppler/poppler/Gfx.cc:4300
#2  0x0000000000487dce in Gfx::opXObject (this=0x760540, args=<optimized out>,
numArgs=<optimized out>)
    at /discs/fast/core/workdir/UnpackedTarball/poppler/poppler/Object.h:441
#3  0x000000000047eba3 in Gfx::go (this=this@entry=0x760540,
topLevel=topLevel@entry=false)
    at /discs/fast/core/workdir/UnpackedTarball/poppler/poppler/Gfx.cc:685
#4  0x000000000047f320 in Gfx::display (this=this@entry=0x760540,
obj=obj@entry=0x75c708, topLevel=topLevel@entry=false)
    at /discs/fast/core/workdir/UnpackedTarball/poppler/poppler/Gfx.cc:646
#5  0x000000000047f7f7 in Gfx::drawForm (this=0x760540, str=0x75c708,
resDict=<optimized out>, matrix=<optimized out>, bbox=0x75c698, 
    transpGroup=<optimized out>, softMask=false, blendingColorSpace=0x0,
isolated=false, knockout=false, alpha=false, transferFunc=0x0,
backdropColor=0x0)
    at /discs/fast/core/workdir/UnpackedTarball/poppler/poppler/Gfx.cc:4836
#6  0x0000000000483338 in Gfx::doTilingPatternFill (this=0x760540,
tPat=0x75c680, stroke=<optimized out>, eoFill=<optimized out>, text=<optimized
out>)
    at /discs/fast/core/workdir/UnpackedTarball/poppler/poppler/Gfx.cc:2185
#7  0x0000000000483c4d in Gfx::opEOFill (this=0x760540, args=<optimized out>,
numArgs=<optimized out>)
    at /discs/fast/core/workdir/UnpackedTarball/poppler/poppler/Gfx.cc:1775
#8  0x000000000047eba3 in Gfx::go (this=this@entry=0x760540,
topLevel=topLevel@entry=true)
    at /discs/fast/core/workdir/UnpackedTarball/poppler/poppler/Gfx.cc:685
#9  0x000000000047f320 in Gfx::display (this=this@entry=0x760540,
obj=obj@entry=0x7fffffffd8c0, topLevel=topLevel@entry=true)
    at /discs/fast/core/workdir/UnpackedTarball/poppler/poppler/Gfx.cc:646
#10 0x00000000004cc330 in Page::displaySlice (this=0x75d680,
out=0x7fffffffdc20, hDPI=<optimized out>, vDPI=7200, rotate=0,
useMediaBox=true, crop=true, 
    sliceX=-1, sliceY=-1, sliceW=-1, sliceH=-1, printing=true,
abortCheckCbk=0x0, abortCheckCbkData=0x0, annotDisplayDecideCbk=0x0, 
    annotDisplayDecideCbkData=0x0, copyXRef=false) at
/discs/fast/core/workdir/UnpackedTarball/poppler/poppler/Page.cc:584
#11 0x00000000004cc5d8 in Page::display (this=<optimized out>,
out=out@entry=0x7fffffffdda0, hDPI=hDPI@entry=2.4858339854353144e-317, 
    vDPI=vDPI@entry=-nan(0xfffffffffffff), rotate=rotate@entry=-1,
useMediaBox=useMediaBox@entry=255, crop=crop@entry=255,
printing=printing@entry=true, 
    abortCheckCbk=0x0, abortCheckCbkData=0x0, annotDisplayDecideCbk=0x0,
annotDisplayDecideCbkData=0x0, copyXRef=false)
    at /discs/fast/core/workdir/UnpackedTarball/poppler/poppler/Page.cc:530
#12 0x00000000004d4e42 in PDFDoc::displayPage (this=this@entry=0x7fffffffdaa0,
out=0x7fffffffdda0, out@entry=0x7fffffffdc20, page=page@entry=1, 
    hDPI=2.4858339854353144e-317, hDPI@entry=7200, vDPI=-nan(0xfffffffffffff),
vDPI@entry=7200, rotate=-1, rotate@entry=0, useMediaBox=255, 
    useMediaBox@entry=true, crop=255, crop@entry=true, printing=<optimized
out>, abortCheckCbk=<optimized out>, abortCheckCbkData=<optimized out>, 
    annotDisplayDecideCbk=<optimized out>, annotDisplayDecideCbkData=<optimized
out>, copyXRef=false)
    at /discs/fast/core/workdir/UnpackedTarball/poppler/poppler/PDFDoc.cc:608
#13 0x00000000004170ac in main (argc=<optimized out>, argv=<optimized out>) at
/discs/fast/core/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx:177

it looks like poppler has a hook to tell the output device about the whole
pattern in one go (useTilingPatternFill and tilingPatternFill), so implementing
that would do it.

A hack would be to add an optimisatino into DrawXmlOptimizer I think -
tree/drawtreevisiting.cxx

I'll have a look.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to