Verify WhiteIsZero invert, add Gray(1) color type

This was found through the fax4 decoding that is always bilevel.

No longer silently ignore an unknown color type when a photometric
interpretation requires an inversion. DICOM requires that WhiteIsZero
and BlackIsZero are only used for samples-per-pixel=1 but we do not
strictly enforce that early. Previously for the result Multiband color
we just ignored the tag which is also not right.
This commit is contained in:
Aurelia Molzer committed 2025-09-01 00:25:48 +02:00
1 parent 7c6c327817
commit bc71086a96
5 files changed
+33 -8

No files matched your search

+6
View File
@@ -678,3 +678,9 @@ fn bytes_gray_f32() {
fn test_fax4() {
test_image_sum_u8("fax4.tiff", ColorType::Gray(1), 7802706);
}
#[test]
#[cfg(feature = "fax")]
fn test_fax4_white_is_min() {
test_image_sum_u8("imagemagick_group4.tiff", ColorType::Gray(1), 3742820);
}
Binary file not shown.