Skip to content

Commit

Permalink
fix: Correct the Farbfeld feature flag for ImageFormat::{reading_enab…
Browse files Browse the repository at this point in the history
…led, writing_enabled} (#2182)

The feature flag is now called "ff" instead of "farbfeld" in image '0.25'
  • Loading branch information
foresterre committed Mar 26, 2024
1 parent d407e36 commit 73c7bfe
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"),
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit 73c7bfe

Please sign in to comment.