RFR: 8306707: Support pluggable image loading via javax.imageio [v18]

Michael Strauß mstrauss at openjdk.org
Fri Nov 8 21:31:54 UTC 2024


On Fri, 8 Nov 2024 18:44:22 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> Michael Strauß has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - move automatically added imports
>>  - rename test...javax -> test...java2d
>
> modules/javafx.graphics/src/main/java/com/sun/javafx/iio/png/PNGImageLoader2.java line 316:
> 
>> 314:                         : ImageStorage.ImageType.RGB;
>> 315:             case PNG_COLOR_PALETTE:
>> 316:                 return ImageStorage.ImageType.PALETTE;
> 
> Why was this case removed? Is it not used?

`PNG_COLOR_PALETTE` is always decoded into an RGB/A `ImageType`, never into a palette type. See L684:

        ImageFrame imgPNG = colorType == PNG_COLOR_PALETTE
                ? decodePalette(bb.array(), metaData)
                : new ImageFrame(getType(), bb, width, height, bpp * width, metaData);


The `getType()` method is never invoked with `PNG_COLOR_PALETTE`.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1593#discussion_r1835076460


More information about the openjfx-dev mailing list