[poppler] Patches for SplashBitmap/PNGWriter

Stefan Thomas thomas at txtbear.com
Tue Jul 20 09:02:40 PDT 2010


  Merged patches into one and fixed last two compiler warnings.

@Albert: Assuming you agree with me on the duplicate code issue, this 
should be ready to be committed.

On 7/16/2010 3:32 PM, Albert Astals Cid wrote:
> 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
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Add-support-for-transparent-PNGs-to-PNGWriter-and-Sp.patch
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20100720/6ace0950/attachment.asc>


More information about the poppler mailing list