Open SamStephens opened 14 hours ago
This image has a similar issue but has SOF type 0xce
Unfortunately, your sample files uses "arithmetic coding" (instead of the normal Huffman coding used by baseline JPEG). This part of the standard is not supported by the version of libjpeg that Java uses, due to patent issues. That means we can't read it either (I belive the patents are now expired, and the JDK could probably enable this feature, but it's not widely used so it probably won't happen).
It might be possible to add support for this in the Java code that we use for lossless decoding, but I need to look deeper into that. Probably non-trivial. I might be able to help, but my time is limited these days. Feel free to look into adding this support and create a PR!
Describe the bug
When I try and load the attached JPEG, I get the the error Unsupported JPEG process: SOF type 0xcf.
As far as I can tell, this image is a valid JPEG. It opens in Gimp, a webtool I found claims it's valid, and I can open it with Pillow on Python.
Version information
The version of the TwelveMonkeys ImageIO library in use. 3.12.0
The exact output of
java --version
(orjava -version
for older Java releases).My stack trace is from a unit test for a Gradle based project running on Ubuntu on WSL2.
To Reproduce Steps to reproduce the behavior:
com.twelvemonkeys.imageio:imageio-jpeg:3.12.0
.ImageIO.read
.Expected behavior The image to be loaded successfully.
Example code Preferably as a failing JUnit test, or a standalone program with a
main
method that showcases the problem.Sample file(s)
https://github.com/user-attachments/assets/74a4f726-312e-47d6-8ff9-cfb7f1f80b3b
Stack trace
Screenshots
N/A
Additional context
N/A