diff --git a/.gitignore b/.gitignore index 4ad8ac2..dbb6995 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ - /target/ **/*.rs.bk Cargo.lock tests/benches/corpus/ +.idea +.agentbridge \ No newline at end of file diff --git a/src/decoder/image.rs b/src/decoder/image.rs index 071d28c..fd062d0 100644 --- a/src/decoder/image.rs +++ b/src/decoder/image.rs @@ -467,11 +467,11 @@ impl Image { } Some(map) } - None => { - return Err(TiffError::FormatError( - TiffFormatError::RequiredTagNotFound(Tag::ColorMap), - )); - } + // A missing palette is not an error. The pixel values of an indexed image are just + // indices into the palette, and the palette itself is only display information, so + // the image still decodes. Callers observe the absence as `None` from + // `Decoder::color_map`. + None => None, } } else { None diff --git a/src/directory.rs b/src/directory.rs index 336abae..be275da 100644 --- a/src/directory.rs +++ b/src/directory.rs @@ -171,7 +171,7 @@ mod tests { dir.get(Tag::Unknown(1)) .expect("tag 1 should be present after this chain") .count(), - u16::MAX.into() + u64::from(u16::MAX) ); }