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:
1 parent
458a713827
commit
e92cf219a9
4 files changed
+26
-21
No files matched your search
@@ -287,7 +287,6 @@ fn test_tiled_incremental() {
|
||||
|
||||
#[test]
|
||||
fn test_div_zero() {
|
||||
use tiff::tags;
|
||||
use tiff::{TiffError, TiffFormatError};
|
||||
|
||||
let image = [
|
||||
@@ -298,12 +297,10 @@ fn test_div_zero() {
|
||||
178, 178, 178,
|
||||
];
|
||||
|
||||
let mut decoder = tiff::decoder::Decoder::new(std::io::Cursor::new(&image)).unwrap();
|
||||
|
||||
let err = decoder.read_image().unwrap_err();
|
||||
let err = tiff::decoder::Decoder::new(std::io::Cursor::new(&image)).unwrap_err();
|
||||
|
||||
match err {
|
||||
TiffError::FormatError(TiffFormatError::InvalidTagValueType(tags::Tag::TileWidth)) => {}
|
||||
TiffError::FormatError(TiffFormatError::StripTileTagConflict) => {}
|
||||
unexpected => panic!("Unexpected error {}", unexpected),
|
||||
}
|
||||
}
|
||||
@@ -385,3 +382,8 @@ fn test_stripped_image_overflow() {
|
||||
unexpected => panic!("Unexpected error {}", unexpected),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_no_rows_per_strip() {
|
||||
test_image_sum_u8("no_rows_per_strip.tiff", ColorType::RGB(8), 99448840);
|
||||
}
|
||||
Reference in new issue
Block a user