Processed review comment

This commit is contained in:
Robert Wassens committed 2020-12-07 11:43:09 +01:00
1 parent 76173069a3
commit 5346a441ae
2 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -760,7 +760,7 @@ impl<'a, W: 'a + Write + Seek, T: ColorType> ImageEncoder<'a, W, T> {
/// Set image number of lines per strip
///
/// This function must be called before calling write_data() or write_strip().
/// `write_strip` and will return an error otherwise.
pub fn rows_per_strip(&mut self, value: u32) -> TiffResult<()> {
if self.strip_idx != 0 {
return Err(io::Error::new(
+4 -4
View File
@@ -381,6 +381,7 @@ fn test_rows_per_strip() {
image.write_strip(&img2[..]).unwrap();
}
assert!(image.write_strip(&img2[..]).is_err());
image.finish().unwrap();
}
file.seek(SeekFrom::Start(0)).unwrap();
@@ -391,10 +392,9 @@ fn test_rows_per_strip() {
for i in 0..50 {
let img2 = [i; 2 * 100];
if let DecodingResult::U8(data) = decoder.read_strip().unwrap() {
assert_eq!(&img2[..], &data[..]);
} else {
assert!(false);
match decoder.read_strip().unwrap() {
DecodingResult::U8(data) => assert_eq!(&img2[..], &data[..]),
other => panic!("Incorrect strip type {:?}", other),
}
}
}