[poppler] pdftops -optimizecolorspace and ImageStream::reset()

Albert Astals Cid aacid at kde.org
Fri Sep 11 09:57:25 UTC 2020


El dijous, 10 de setembre de 2020, a les 23:00:57 CEST, William Bader va escriure:
> 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?

Everyting should be able to reset + re.read, i mean it's just data on disk/memory so i don't see why it wouldn't work (without bugs).

Cheers,
  Albert

> 
> I can post a bug report, including the PDF, which is only 350KB, if it would help.
> 
> Thanks, William
> 






More information about the poppler mailing list