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.
2 parents 80b2124 + 5d01806 commit 96352c4Copy full SHA for 96352c4
src/codecs/tiff.rs
@@ -53,6 +53,21 @@ where
53
Err(other) => return Err(ImageError::from_tiff_decode(other)),
54
};
55
56
+ let planar_config = inner
57
+ .find_tag(tiff::tags::Tag::PlanarConfiguration)
58
+ .map(|res| res.and_then(|r| r.into_u16().ok()).unwrap_or_default())
59
+ .unwrap_or_default();
60
+
61
+ // Decode not supported for non Chunky Planar Configuration
62
+ if planar_config > 1 {
63
+ Err(ImageError::Unsupported(
64
+ UnsupportedError::from_format_and_kind(
65
+ ImageFormat::Tiff.into(),
66
+ UnsupportedErrorKind::GenericFeature(String::from("PlanarConfiguration = 2")),
67
+ ),
68
+ ))?;
69
+ }
70
71
let color_type = match tiff_color_type {
72
tiff::ColorType::Gray(8) => ColorType::L8,
73
tiff::ColorType::Gray(16) => ColorType::L16,
0 commit comments