-
-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tif image throws "Destination type from ImageReadParam does not match legal imageTypes from reader: javax.imageio.ImageTypeSpecifier" #651
Comments
Thanks! Will look into it. |
Okay, My finding so far is that this TIFF file uses CMYK + 1 extra sample. The However, I think the reader should just treat this value as 0. But there's no standard way in Java2D to express this kind of pixel layout, so I had to create my own Not sure about the other two test fails yet, but I think they are related. PS: The image is also displayed weird in MacOS Preview, where the extra channel is treated as alpha (but the alpha channel isn't aligned with the color data). |
…ray. (cherry picked from commit 433311c)
…ith ImageTypeSpecifier comparison. (cherry picked from commit 98e4b76)
Pushed some fixes now! Just in time to prepare the turkey.. 😉 I didn't add your sample file to the tests as it's quite large, and I could verify I fixed the problems in the Merry Christmas! 🎄 |
Merry Christmas to you too. |
I'm not sure if this is because of a bug, or if the image just actually isn't "a correct tif file" so to speak.
I've created a branch to test this, against the 3.8.0 release commit.
I've also tested it against the current latest commit, the behavior is identical.
Describe the bug
A Tiff image seemingly cannot be parsed
Version information
3.8.0
java --version
(orjava -version
for older Java releases).For example:
To Reproduce
Expected behavior
A branch has been created, running the unit tests displays the behavior.
Example code
I created a branch here and simply added a file to the test: https://github.com/KoenDG/TwelveMonkeys/blob/3c3c76b428924f0db6795b6eb8cb7ccb5b7576f0/imageio/imageio-tiff/src/test/java/com/twelvemonkeys/imageio/plugins/tiff/TIFFImageReaderTest.java
Sample file(s)
Added here on the local branch: https://github.com/KoenDG/TwelveMonkeys/blob/3c3c76b428924f0db6795b6eb8cb7ccb5b7576f0/imageio/imageio-tiff/src/test/resources/new/27d40bc5f25d8382b890766accb28cf7.tif
Stak trace
The error one gets when running
mvn clean package
The text was updated successfully, but these errors were encountered: