Merge pull request #394 from powturns/main

Add PhotometricInterpretation unknown tag support
This commit is contained in:
Aurelia Molzer authored and GitHub committed 2026-06-02 17:50:20 +00:00
commit 22b4c39254
2 files changed
+12 -7

No files matched your search

+8 -6
View File
@@ -660,12 +660,14 @@ impl Image {
), ),
)), )),
PhotometricInterpretation::RGBPalette => Ok(ColorType::Palette(self.bits_per_sample)), PhotometricInterpretation::RGBPalette => Ok(ColorType::Palette(self.bits_per_sample)),
PhotometricInterpretation::TransparencyMask => Err(TiffError::UnsupportedError( PhotometricInterpretation::TransparencyMask | PhotometricInterpretation::Unknown(_) => {
TiffUnsupportedError::InterpretationWithBits( Err(TiffError::UnsupportedError(
self.photometric_interpretation, TiffUnsupportedError::InterpretationWithBits(
vec![self.bits_per_sample; self.samples as usize], self.photometric_interpretation,
), vec![self.bits_per_sample; self.samples as usize],
)), ),
))
}
} }
} }
+4 -1
View File
@@ -295,7 +295,10 @@ pub enum CompressionMethod(u16) unknown(
} }
tags! { tags! {
pub enum PhotometricInterpretation(u16) { pub enum PhotometricInterpretation(u16) unknown(
/// A private or extension tag
unknown
) {
WhiteIsZero = 0, WhiteIsZero = 0,
BlackIsZero = 1, BlackIsZero = 1,
RGB = 2, RGB = 2,