Support 32-bit rgb and rgba decoding
This commit is contained in:
1 parent
fca4e1f88a
commit
1f92c562bc
3 files changed
+32
-2
No files matched your search
@@ -103,6 +103,25 @@ fn test_rgb_u16() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rgb_u32() {
|
||||
let img_file = File::open("./tests/images/gradient-3c-32b.tiff").expect("Cannot find test image!");
|
||||
let mut decoder = Decoder::new(img_file).expect("Cannot create decoder");
|
||||
assert_eq!(decoder.colortype().unwrap(), ColorType::RGB(32));
|
||||
let img_res = decoder.read_image().unwrap();
|
||||
if let DecodingResult::U32(res) = img_res {
|
||||
let mut res_sum: u64 = 0;
|
||||
for x in res {
|
||||
res_sum += x as u64;
|
||||
}
|
||||
|
||||
assert_eq!(res_sum, 2030834111716);
|
||||
}
|
||||
else {
|
||||
panic!("Wrong bit depth")
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_string_tags() {
|
||||
// these files have null-terminated strings for their Software tag. One has extra bytes after
|
||||
|
||||
Reference in new issue
Block a user