Skip to content

Commit 1556713

Browse files
committed
Simplify match in invert
1 parent 682ef0c commit 1556713

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/decoder/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,8 @@ fn invert_colors(
481481
sample_format: SampleFormat,
482482
) -> TiffResult<()> {
483483
match (color_type, sample_format) {
484-
(ColorType::Gray(n), SampleFormat::Uint) if 8 % n == 0 => {
484+
// Where pixels do not cross a byte boundary
485+
(ColorType::Gray(1 | 2 | 4 | 8), SampleFormat::Uint) => {
485486
for x in buf {
486487
// Equivalent to both of the following:
487488
//

0 commit comments

Comments
 (0)