[poppler] Patches for SplashBitmap/PNGWriter

Albert Astals Cid aacid at kde.org
Fri Jul 16 06:32:46 PDT 2010


A Dissabte, 10 de juliol de 2010, Stefan Thomas va escriure:
> Hello!
> 
> I've got two new patches for the cause.
> 
> The first one adds transparent PNG support to PNGWriter and
> SplashBitmap. The uses for this are varied and many, so I think it makes
> sense to add this to the mainline, even though I don't have the pdftoppm
> patch to go along with it. (We're using it in a custom SplashOutputDev.)

Seems like it duplicates some code from the other method, would it be possible 
to merge them a bit more?

> 
> The second one fixes a nasty bug in SplashBitmap that causes "pdftoppm
> -jpeg" to randomly produce corrupt images. Currently SplashBitmap frees
> its temporary buffers and later calls ImgWriter::close(). Problem is
> libjpeg still uses these temporary buffers during
> jpeg_finish_compress(). So if they've been reclaimed - bad things
> happen. Usually libjpeg aborts and produces an image with the bottom
> fifty or so rows missing. The patch also fixes the SplashBitmap throwing
> a splashErrGeneric despite success, which was due to a missing question
> mark before writer->close().

valgrind does not complain about it when i do
  valgrind ./utils/pdftoppm -jpeg ~/pdf_reference_1-7.pdf -f 1 -l 1 foo

Are you sure that is the problem?

Albert

> 
> Hope you find it useful.
> 
> Cheers,
> 
> Stefan Thomas


More information about the poppler mailing list