-
-
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
Incorrect source subsampling for bmp #694
Comments
Hi, Thanks for reporting! I think can reproduce the issue you describe, but only for some BMPs (24 bit/pixel BMPs). Using the test file I get this result: While the expected result should be: (The problem is that the subsampling don't take into account that the samples are wider than the data type, ie. 24 bits/pixel is 3 bytes/pixel. This is why you see 1/3rd of the image horizontally subsampled, then the next 2/3rds non-subsampled but truncated.) |
Closing for now, let me know if you still have issues using the latest snapshot release. |
Hello. I didn't think you would fix this so soon, Anyway: Btw, the logic seem suspect to me
Why are you testing the bitcount when it already is confirmed to be 24? |
Oh, my bad, I didn't realize switch with fall-through is still a thing in older Java versions. Nvm |
Snapshots can be found here (link on the front page). But building yourself is also good! 😀 And yes, I considered having completely separate branches for the <= 8 bit case and the 24 bit case, but it would just be more duplicated code (and scope issues) so I kept the fall-troughs as it was. |
I have never realized until today that the badges on top of README file are clickable! That's why I could not find the snapshots. |
Describe the bug
IIOParam.setSourceSubsampling(2, 2, 0, 0) causes incorrect reading of image if sourceXSubsampling or sourceXSubsampling is not 1. Image is rendered twice, scaled and overlapped. Happens only for bmp images. I suspect a typo in x and y coordinates somewhere in the algorithm.
Version information
The version of the TwelveMonkeys ImageIO library in use.
3.8.2
The exact output of
java --version
(orjava -version
for older Java releases).For example:
Win 10, JDK17 IBM Semeru
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Unscaled uncropped image
Example code
On my system, the
reader
's class iscom.twelvemonkeys.imageio.plugins.bmp.BMPImageReader
Sample file(s)
I'll upload image if necessary. It seems this concerns every bmp image.
The text was updated successfully, but these errors were encountered: