Merge #4407 (image-codecs: tests pass with the tiff feature off)

This commit is contained in:
dotCooCoo committed 2026-11-29 21:43:09 -08:00
commit 6c680ec358
2 files changed
+4 -2

No files matched your search

@@ -159,7 +159,8 @@ fn png_phys_in_metres_only_before_image_data() {
fn agrees_with_decode_for_encoded_files() {
let mut img = Image::from_raw(2, 1, ChannelLayout::Rgb, SampleType::U8, vec![10, 20, 30, 40, 50, 60]).unwrap();
img.meta.dpi = Some((300.0, 150.0));
for format in [Format::Jpeg, Format::Png, Format::WebP, Format::Tiff] {
let formats = [Format::Jpeg, Format::Png, Format::WebP, Format::Tiff];
for format in formats.into_iter().filter(|f| !matches!(f, Format::Tiff) || cfg!(feature = "tiff")) {
let bytes = crate::encode(&img, format, &EncodeOptions::default()).unwrap();
let decoded = crate::decode_as(format, &bytes).unwrap().meta.dpi;
assert_eq!(file_resolution(&bytes), decoded, "{format:?}");
+2 -1
View File
@@ -144,7 +144,8 @@ fn hdr_float_to_fits_clips() {
#[cfg(all(feature = "exr", feature = "pnm"))]
#[test]
fn float_to_exr_and_tiff_is_clean() {
for f in [Format::OpenExr, Format::Tiff, Format::Pnm] {
let formats = [Format::OpenExr, Format::Tiff, Format::Pnm];
for f in formats.into_iter().filter(|f| !matches!(f, Format::Tiff) || cfg!(feature = "tiff")) {
assert!(warns(&test_image(ChannelLayout::Rgb, SampleType::F32), f).is_empty(), "{f:?}");
}
}