From 80b55dee5a4a33e5cedd38df16c10f2aebaeeb82 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 13 Nov 2026 09:00:23 -0500 Subject: [PATCH] Allow alpha in IFF compatibility encoder --- crates/raster-codecs/src/iff.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/raster-codecs/src/iff.rs b/crates/raster-codecs/src/iff.rs index b2d44b89a..95e439a58 100644 --- a/crates/raster-codecs/src/iff.rs +++ b/crates/raster-codecs/src/iff.rs @@ -9,8 +9,8 @@ pub fn decode(bytes: &[u8], limits: &Limits) -> Result { bridge::format(Format::Iff, bytes, limits) } pub fn encode(image: &Image) -> Result, CodecError> { - if image.layout() != crate::ChannelLayout::Rgb || image.sample_type() != crate::SampleType::U8 { - return Err(CodecError::encode("IFF", "ILBM writer stores 8-bit RGB pixels")); + if !matches!(image.layout(), crate::ChannelLayout::Rgb | crate::ChannelLayout::Rgba) || image.sample_type() != crate::SampleType::U8 { + return Err(CodecError::encode("IFF", "ILBM writer stores 8-bit RGB pixels with optional alpha")); } bridge::encode(image, Format::Iff, &Default::default()) }