Fix the mandrill.tiff regression (#145)

* fix mandrill.tiff regression from upstream

* use contains_key(), added StripTileTagConflict error

* updated test_div_zero, added test_no_rows_per_strip
This commit is contained in:
Tomáš Král authored and GitHub committed 2021-06-17 09:22:07 -04:00
1 parent 458a713827
commit e92cf219a9
4 files changed
+26 -21

No files matched your search

+2
View File
@@ -63,6 +63,7 @@ pub enum TiffFormatError {
SignedIntegerExpected(Value),
Format(String),
RequiredTagEmpty(Tag),
StripTileTagConflict,
#[doc(hidden)]
/// Do not match against this variant. It may get removed.
__NonExhaustive,
@@ -113,6 +114,7 @@ impl fmt::Display for TiffFormatError {
}
Format(ref val) => write!(fmt, "Invalid format: {:?}.", val),
RequiredTagEmpty(ref val) => write!(fmt, "Required tag {:?} was empty.", val),
StripTileTagConflict => write!(fmt, "File should contain either (StripByteCounts and StripOffsets) or (TileByteCounts and TileOffsets), other combination was found."),
__NonExhaustive => unreachable!(),
}
}