We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02d98b3 commit 075badaCopy full SHA for 075bada
src/decoder.rs
@@ -174,8 +174,8 @@ impl<R: Read> Decoder<R> {
174
Some(ref frame) => {
175
let pixel_format = match frame.components.len() {
176
1 => match frame.precision {
177
- 8 => PixelFormat::L8,
178
- 16 => PixelFormat::L16,
+ 2..=8 => PixelFormat::L8,
+ 9..=16 => PixelFormat::L16,
179
_ => panic!(),
180
},
181
3 => PixelFormat::RGB24,
@@ -361,7 +361,7 @@ impl<R: Read> Decoder<R> {
361
frame.precision,
362
)));
363
}
364
- if frame.precision != 8 && frame.precision != 16 {
+ if !(2..=16).contains(&frame.precision) {
365
return Err(Error::Unsupported(UnsupportedFeature::SamplePrecision(
366
367
0 commit comments