From 1556713d6eed44837fec6029aaf9025f6b4dc05e Mon Sep 17 00:00:00 2001 From: Aurelia Molzer <5550310+197g@users.noreply.github.com> Date: Mon, 1 Sep 2025 02:05:56 +0200 Subject: [PATCH] Simplify match in invert --- src/decoder/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/decoder/mod.rs b/src/decoder/mod.rs index dc4768a..d4db1c2 100644 --- a/src/decoder/mod.rs +++ b/src/decoder/mod.rs @@ -481,7 +481,8 @@ fn invert_colors( sample_format: SampleFormat, ) -> TiffResult<()> { match (color_type, sample_format) { - (ColorType::Gray(n), SampleFormat::Uint) if 8 % n == 0 => { + // Where pixels do not cross a byte boundary + (ColorType::Gray(1 | 2 | 4 | 8), SampleFormat::Uint) => { for x in buf { // Equivalent to both of the following: //