[poppler] pdftops -optimizecolorspace and ImageStream::reset()
William Bader
williambader at hotmail.com
Thu Sep 10 21:00:57 UTC 2020
I have a PDF where 'pdftops -level1sep -optimizecolorspace' gets 'Syntax Error: Could not find start of jpeg data' and drops part of the image.
The problem happens in PSOutputDev::doImageL1Sep() where it prescans the image by making a new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits()).
When I made the patch to add -optimizecolorspace, I had first tried scanning the original stream and then using imgStr->reset(), but it didn't work for some types of streams, so I switched creating a new stream, which is the code currently in poppler.
But even that doesn't seem to work for DCTStream.
Is the problem that some types of streams can never be reread (which means that -optimizecolorspace can't work as written) or that rereading streams isn't well tested and I might be able to fix it by reviewing the initialization?
I can post a bug report, including the PDF, which is only 350KB, if it would help.
Thanks, William
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20200910/32a52369/attachment.htm>
More information about the poppler
mailing list