Return an error for zero-size images
This commit is contained in:
1 parent
0311402999
commit
ef3294d1fe
2 files changed
+8
-1
No files matched your search
@@ -97,6 +97,9 @@ impl Image {
|
||||
|
||||
let width = tag_reader.require_tag(Tag::ImageWidth)?.into_u32()?;
|
||||
let height = tag_reader.require_tag(Tag::ImageLength)?.into_u32()?;
|
||||
if width == 0 || height == 0 {
|
||||
return Err(TiffError::FormatError(TiffFormatError::InconsistentSizesEncountered));
|
||||
}
|
||||
|
||||
let photometric_interpretation = tag_reader
|
||||
.find_tag(Tag::PhotometricInterpretation)?
|
||||
|
||||
Reference in new issue
Block a user