From 6325cd286bd87effa3020b01d6b9d289d4f7c055 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 15 Nov 2026 17:37:54 +0000 Subject: [PATCH] Test AVIF source depth and decoded-image parity --- crates/image-codecs/src/codecs/avif_decode.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/image-codecs/src/codecs/avif_decode.rs b/crates/image-codecs/src/codecs/avif_decode.rs index 4dd15fd7d..eaeafb65d 100644 --- a/crates/image-codecs/src/codecs/avif_decode.rs +++ b/crates/image-codecs/src/codecs/avif_decode.rs @@ -1194,6 +1194,9 @@ mod tests { let src = Image::from_u8(w as u32, h as u32, ChannelLayout::Rgb, card(w, h, 3)).unwrap(); let file = encode_avif_with_speed(&src, 95, 10).unwrap(); let img = crate::decode(&file).unwrap(); + let (with_depth, depth) = crate::decode_avif_with_depth(&file, &crate::DecodeOptions::default()).unwrap(); + assert_eq!(depth, 10); + assert_eq!(with_depth, img); assert_eq!((img.width(), img.height(), img.layout(), img.sample_type()), (48, 32, ChannelLayout::Rgb, SampleType::U16)); let diff = mean_abs_diff(&rgb8(&img), &card(w, h, 3)); assert!(diff < 2.5, "mean difference {diff}");