diff --git a/crates/images/src/tone.rs b/crates/images/src/tone.rs index b5db792bb..0ec3f4da8 100644 --- a/crates/images/src/tone.rs +++ b/crates/images/src/tone.rs @@ -13,10 +13,10 @@ pub enum Tone { /// The [`Tone`] of an image file, `None` when a swatch doesn't colour it. pub fn tone(bytes: &[u8]) -> Option { - if let Some(info) = craft_image_codecs::inspect_raster(bytes).ok().flatten() { - if info.channels > 1 { - return None; - } + if let Some(info) = craft_image_codecs::inspect_raster(bytes).ok().flatten() + && info.channels > 1 + { + return None; } match craft_image_codecs::classify_tone(bytes)? { craft_image_codecs::ToneClass::Bitmap => Some(Tone::Bitmap),