fix: correct extra bits rgb test assertion based on write extra bits
image logic
This commit is contained in:
1 parent
22b4c39254
commit
279851a9a9
2 files changed
+4
-2
No files matched your search
@@ -3,3 +3,4 @@
|
|||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
tests/benches/corpus/
|
tests/benches/corpus/
|
||||||
|
.DS_Store
|
||||||
@@ -16,7 +16,8 @@ macro_rules! test_image_sum {
|
|||||||
fn $name(file: &str, expected_type: ColorType, expected_sum: $sum_ty) {
|
fn $name(file: &str, expected_type: ColorType, expected_sum: $sum_ty) {
|
||||||
let path = PathBuf::from(TEST_IMAGE_DIR).join(file);
|
let path = PathBuf::from(TEST_IMAGE_DIR).join(file);
|
||||||
let img_file = File::open(path).expect("Cannot find test image!");
|
let img_file = File::open(path).expect("Cannot find test image!");
|
||||||
let mut decoder = Decoder::open(img_file).expect("Cannot create decoder");
|
let mut decoder =
|
||||||
|
Decoder::open_with_options(img_file, true).expect("Cannot create decoder");
|
||||||
|
|
||||||
decoder.next_image().expect("Cannot read image IFD");
|
decoder.next_image().expect("Cannot read image IFD");
|
||||||
assert_eq!(decoder.colortype().unwrap(), expected_type);
|
assert_eq!(decoder.colortype().unwrap(), expected_type);
|
||||||
@@ -975,7 +976,7 @@ fn extra_bits_gray() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn extra_bits_rgb() {
|
fn extra_bits_rgb() {
|
||||||
test_image_sum_u8("extra_bits_rgb_8b.tiff", ColorType::RGB(8), 0);
|
test_image_sum_u8("extra_bits_rgb_8b.tiff", ColorType::RGBA(8), 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in new issue
Block a user