RFR: 8364583: ColorConvertOp fails for CMYK → RGB conversion
Sergey Bylokhov
serb at openjdk.org
Thu Oct 16 17:39:33 UTC 2025
On Tue, 14 Oct 2025 05:25:44 GMT, Phil Race <prr at openjdk.org> wrote:
> color is initially returned as 4 element array but we over-write with 3 element and so next time through the loop it is used by but is too short.
> More details in JBS.
src/java.desktop/share/classes/java/awt/image/ColorConvertOp.java line 811:
> 809: for (int x = 0; x < w; x++) {
> 810: pixel = srcRas.getDataElements(x, y, pixel);
> 811: color = srcCM.getNormalizedComponents(pixel, null, 0);
Since this is executed for each pixel, it will generate garbage equal to the image size. Maybe we can cleanly split the usage of the two vars here? Note that the bug only occurs when the source image does not use an ICC profile, but this change would increase garbage for both ICC and non-ICC profiles.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27785#discussion_r2436869668
More information about the client-libs-dev
mailing list