Describe the bug
Some WebP images are decoded with a yellow tint.
Version information
-
The version of the TwelveMonkeys ImageIO library in use.
3.10.1
-
The exact output of java --version (or java -version for older Java releases).
openjdk 21 2023-09-19 LTS
OpenJDK Runtime Environment Temurin-21+35 (build 21+35-LTS)
OpenJDK 64-Bit Server VM Temurin-21+35 (build 21+35-LTS, mixed mode)
- Extra information about OS version, server version, standalone program or web application packaging, executable wrapper, etc. Please state exact version numbers where applicable.
To Reproduce
Steps to reproduce the behavior:
- Add the attached files as test resources for
imageio-webp
- Run the below unit tests
- Check the generated PNG images, and compare to their JPG equivalent
Expected behavior
Images should look alike.
Example code
@Test
public void test1() throws IOException {
testReadTestData(new TestData(getClassLoaderResource("/webp/Example1.webp"), new Dimension(2144, 3200)));
}
@Test
public void test2() throws IOException {
testReadTestData(new TestData(getClassLoaderResource("/webp/Example2.webp"), new Dimension(2144, 3200)));
}
public void testReadTestData(TestData data) throws IOException {
ImageReader reader = createReader();
reader.setInput(data.getInputStream());
for (int i = 0; i < data.getImageCount(); i++) {
BufferedImage image = null;
try {
image = reader.read(i);
File tempActual = File.createTempFile("junit-testRead-", ".png");
System.out.println("tempActual.getAbsolutePath(): " + tempActual.getAbsolutePath());
ImageIO.write(image, "PNG", tempActual);
}
catch (Exception e) {
e.printStackTrace();
failBecause(String.format("Image %s index %s could not be read: %s", data.getInput(), i, e), e);
}
assertNotNull(String.format("Image %s index %s was null!", data.getInput(), i), image);
assertEquals(
String.format("Image %s index %s has wrong width: %s", data.getInput(), i, image.getWidth()),
data.getDimension(i).width,
image.getWidth()
);
assertEquals(
String.format("Image %s index %s has wrong height: %s", data.getInput(), i, image.getHeight()),
data.getDimension(i).height, image.getHeight()
);
}
reader.dispose();
}
Sample file(s)
JPG.zip
WEBP.zip
Screenshots

Additional context
I tested those images in NightMonkeys, and they decode correctly.
Describe the bug
Some WebP images are decoded with a yellow tint.
Version information
The version of the TwelveMonkeys ImageIO library in use.
3.10.1
The exact output of
java --version(orjava -versionfor older Java releases).openjdk 21 2023-09-19 LTS
OpenJDK Runtime Environment Temurin-21+35 (build 21+35-LTS)
OpenJDK 64-Bit Server VM Temurin-21+35 (build 21+35-LTS, mixed mode)
To Reproduce
Steps to reproduce the behavior:
imageio-webpExpected behavior
Images should look alike.
Example code
Sample file(s)
JPG.zip
WEBP.zip
Screenshots

Additional context
I tested those images in NightMonkeys, and they decode correctly.