[OpenJDK 2D-Dev] RFR 6488522: PNG writer should permit setting compression level and iDAT chunk maximum size

Laurent Bourgès bourges.laurent at gmail.com
Fri Dec 11 14:38:59 UTC 2015


Sergey,

2015-12-11 13:02 GMT+01:00 Sergey Bylokhov <Sergey.Bylokhov at oracle.com>:

> Only one thing remain which I would like to clarify.
>
> In the PNGImageWriter the new field deflaterLevel was added(it can be
> private?). This field is initialized by default to
> DEFAULT_COMPRESSION_LEVEL and updated according to the current params. Is
> it possible a situation if two images will use the same writer. During the
> write of the first image deflaterLevel will be changed via params. But in
> the write of the second image the params will be reset to null -> the
> deflaterLevel was not changed. It seems that in this case for the second
> image non-default level will be used?


Good catch !

I fixed that issue by resetting the compression level to the default value
before using or not params.

Here is an updated webrev:
http://cr.openjdk.java.net/~lbourges/png/PNGWriter-6488522.2/

The jtreg ImageCompressionTest still passes (I did not update it).

Cheers,
Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20151211/39fd6482/attachment.html>


More information about the 2d-dev mailing list