[OpenJDK 2D-Dev] [9] RFR JDK-6334602 : Animated GIFs created from opaque PNG image frames appear transparent when loaded with Toolkit APIs

Jayathirth D V jayathirth.d.v at oracle.com
Tue Nov 8 10:00:38 UTC 2016


Hi,

 

Please review the following fix in JDK9 at your convenience:

 

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

 

Webrev : http://cr.openjdk.java.net/~jdv/6334602/webrev.00/ 

 

Issue : When we create GIF from Opaque PNG image and load it with Toolkit API's it is shown as transparent image.

 

Root cause : Issue happens only when we use disposal method - restore to background. Because in this case when getTransparentPixel() returns -1, we explicitly create transparent IndexColorModel so that we can restore to background. While doing this we lose the original IndexColorModel and always newly created transparent IndexColorModel will be considered.

 

Solution : After fix in JDK- 4233748 we have extended GifImageDecoder to include transparent pixel as part of ColorMap. There is no need for us to explicitly check for transparentPixel and try to override present IndexColorModel. So removed the logic for creating new transparent IndexColorModel in case of disposal method - restore to background.

 

Thanks,

Jay

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


More information about the 2d-dev mailing list