[OpenJDK 2D-Dev] [11] RFR JDK-6574555: PNGImageWriter incorrectly sets bKGD chunk

Jayathirth D V jayathirth.d.v at oracle.com
Fri Apr 13 08:53:52 UTC 2018

Hi Phil,


Thanks for your inputs.

I have modified the test case to use ByteArrayOutput/InputStream.


Please find updated webrev for review:






From: Phil Race 
Sent: Wednesday, April 11, 2018 10:40 PM
To: Jayathirth D V; 2d-dev
Subject: Re: [OpenJDK 2D-Dev] [11] RFR JDK-6574555: PNGImageWriter incorrectly sets bKGD chunk


The fix seems fine but like the other review I wonder if
the test can use a bytearrayoutputstream instead of writing to a file.


On 04/11/2018 03:51 AM, Jayathirth D V wrote:

Hello All,


Please review the following fix in JDK11 :


Bug : https://bugs.openjdk.java.net/browse/JDK-6574555 

Webrev : HYPERLINK "http://cr.openjdk.java.net/%7Ejdv/6574555/webrev.00/"http://cr.openjdk.java.net/~jdv/6574555/webrev.00/ 


Issue: PNGImageWriter. write_bKGD() function sets incorrect R, G, B value when IHDR colortype and bKGD colortype is PNG_COLOR_RGB(A).


Solution: Assign values to all channels of RGB as they are present in Metadata instead of using only bKGD red value.


Note : Our default metadata doesn't set any bKGD chunk but if user specifies bKGD chunk and uses mergeTree() then we check bKGD  R, G, B values and if r == g == b then we store bKGD chunk as of type PNG_COLOR_GRAY.





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20180413/98438baa/attachment.html>

More information about the 2d-dev mailing list