Skip to content

fix: correct interpretation of extra samples with unspecified type of alpha#390

Open
soyosaki wants to merge 4 commits into
image-rs:mainfrom
soyosaki:main
Open

fix: correct interpretation of extra samples with unspecified type of alpha#390
soyosaki wants to merge 4 commits into
image-rs:mainfrom
soyosaki:main

Conversation

@soyosaki
Copy link
Copy Markdown

@soyosaki soyosaki commented May 9, 2026

The commit should correct how TIFF images with samples count larger than photometric samples count are interpreted. For example, if a TIFF image claims a RGB photometric interpretation, a 8 8 8 8 bits-per-sample array, and an unspecified extra samples field (i.e. ExtraSamples = 0), the current commit should interpret the image as an RGBA image with the extra sample be treated as the alpha channel of the image, whereas currently the crate would interpret it as a RGB image and produce a corrupted pixel map.

The test extra_bits_rgb is fixed together, and it should now align with the logic of extra_bits_gray and write_extra_bits_image.

@soyosaki
Copy link
Copy Markdown
Author

The latest commit should address the decode issue related to TIFF data in RGB with more than 1 extra samples. Clippy warning appear unrelated to the changes on the current branch.

@soyosaki
Copy link
Copy Markdown
Author

soyosaki commented Jun 1, 2026

Merged latest main, now all checks are passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant