You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
@Testpublicvoidtest1() throwsIOException {
testReadTestData(newTestData(getClassLoaderResource("/webp/Example1.webp"), newDimension(2144, 3200)));
}
@Testpublicvoidtest2() throwsIOException {
testReadTestData(newTestData(getClassLoaderResource("/webp/Example2.webp"), newDimension(2144, 3200)));
}
publicvoidtestReadTestData(TestDatadata) throwsIOException {
ImageReaderreader = createReader();
reader.setInput(data.getInputStream());
for (inti = 0; i < data.getImageCount(); i++) {
BufferedImageimage = null;
try {
image = reader.read(i);
FiletempActual = File.createTempFile("junit-testRead-", ".png");
System.out.println("tempActual.getAbsolutePath(): " + tempActual.getAbsolutePath());
ImageIO.write(image, "PNG", tempActual);
}
catch (Exceptione) {
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();
}
Thanks for the samples! I believe this is the same issue as reported in #785 .
I haven't been able to find the exact problem, but I believe there is some small rounding or other error that accumulates during decoding, as the problem is typically most visible in the lower right corner of the decoded image.
I will look into it, but any help on pinpointing or fixing the issue would be greatly appreciated! 😀
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 -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)
To Reproduce
Steps to reproduce the behavior:
imageio-webp
Expected 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.
The text was updated successfully, but these errors were encountered: