From 73c7bfe8e26cef3df929fad76297f653d1c8decf Mon Sep 17 00:00:00 2001 From: Martijn Gribnau Date: Tue, 26 Mar 2024 02:04:57 +0000 Subject: [PATCH] fix: Correct the Farbfeld feature flag for ImageFormat::{reading_enabled, writing_enabled} (#2182) The feature flag is now called "ff" instead of "farbfeld" in image '0.25' --- src/image.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/image.rs b/src/image.rs index 49077c26bf..d4c99d8ad2 100644 --- a/src/image.rs +++ b/src/image.rs @@ -318,7 +318,7 @@ impl ImageFormat { ImageFormat::Hdr => cfg!(feature = "hdr"), ImageFormat::OpenExr => cfg!(feature = "openexr"), ImageFormat::Pnm => cfg!(feature = "pnm"), - ImageFormat::Farbfeld => cfg!(feature = "farbfeld"), + ImageFormat::Farbfeld => cfg!(feature = "ff"), ImageFormat::Avif => cfg!(feature = "avif"), ImageFormat::Qoi => cfg!(feature = "qoi"), ImageFormat::Dds => false, @@ -337,7 +337,7 @@ impl ImageFormat { ImageFormat::Tiff => cfg!(feature = "tiff"), ImageFormat::Tga => cfg!(feature = "tga"), ImageFormat::Pnm => cfg!(feature = "pnm"), - ImageFormat::Farbfeld => cfg!(feature = "farbfeld"), + ImageFormat::Farbfeld => cfg!(feature = "ff"), ImageFormat::Avif => cfg!(feature = "avif"), ImageFormat::WebP => cfg!(feature = "webp"), ImageFormat::OpenExr => cfg!(feature = "openexr"), @@ -1805,12 +1805,20 @@ mod tests { #[test] fn reading_enabled() { assert_eq!(cfg!(feature = "jpeg"), ImageFormat::Jpeg.reading_enabled()); + assert_eq!( + cfg!(feature = "ff"), + ImageFormat::Farbfeld.reading_enabled() + ); assert!(!ImageFormat::Dds.reading_enabled()); } #[test] fn writing_enabled() { assert_eq!(cfg!(feature = "jpeg"), ImageFormat::Jpeg.writing_enabled()); + assert_eq!( + cfg!(feature = "ff"), + ImageFormat::Farbfeld.writing_enabled() + ); assert!(!ImageFormat::Hdr.writing_enabled()); assert!(!ImageFormat::Dds.writing_enabled()); }