image-rs / image-tiff

TIFF decoding and encoding library in pure Rust
MIT License
121 stars 79 forks source link

Allow arbitrary number of samples as long as all have the same bit depth #215

Closed fintelia closed 1 year ago

fintelia commented 1 year ago

As was pointed out in #214 , there doesn't seem to be any reason to return an unsupported error if samples isn't 1, 2, or 4.

This PR doesn't modify the behavior of Decoder::colortype. It will still return an error of type UnsupportedError(InterpretationWithBits(..)) on such images. Matching on the error should expose the BitsPerSample and SamplesPerPixel values, though we should probably add a better way to access that information

tromper commented 1 year ago

Any thoughts on this? It covers everything that is in #216 as well, so that can be ignored if we can merge this.

fintelia commented 1 year ago

Forgot about this PR... thanks for the reminder to merge!