style: cargo fmt

This commit is contained in:
Dylan M. Taylor committed 2026-11-14 18:48:46 +00:00
1 parent 9331058ee3
commit 01c63a0e9e
2 files changed
+6 -3

No files matched your search

+1 -2
View File
@@ -600,8 +600,7 @@ fn transparent_tiff_without_channels_keeps_image_alpha() {
assert!(img.layout().has_alpha(), "{layers}");
assert!(img.meta.extra_samples.is_empty(), "{layers}");
let parsed = craft_tiff::Tiff::parse(&r.bytes).unwrap();
let extra: Vec<u16> =
parsed.ifds[0].value(craft_tiff::tags::EXTRA_SAMPLES).unwrap().to_u64_vec().into_iter().map(|x| x as u16).collect();
let extra: Vec<u16> = parsed.ifds[0].value(craft_tiff::tags::EXTRA_SAMPLES).unwrap().to_u64_vec().into_iter().map(|x| x as u16).collect();
assert_eq!(extra, vec![2], "{layers}");
assert!(!r.warnings.iter().any(|w| w.contains("Save Transparency")), "{layers}: {:?}", r.warnings);
if layers {
+5 -1
View File
@@ -34,7 +34,11 @@ fn save(doc: &Document, layers: bool, transparency: Option<bool>) -> ExportResul
fn extra_samples_tag(bytes: &[u8]) -> Vec<u16> {
let tiff = craft_tiff::Tiff::parse(bytes).unwrap();
tiff.ifds.first().and_then(|ifd| ifd.value(craft_tiff::tags::EXTRA_SAMPLES)).map(|v| v.to_u64_vec().into_iter().map(|x| x as u16).collect()).unwrap_or_default()
tiff.ifds
.first()
.and_then(|ifd| ifd.value(craft_tiff::tags::EXTRA_SAMPLES))
.map(|v| v.to_u64_vec().into_iter().map(|x| x as u16).collect())
.unwrap_or_default()
}
/// A TIFF's channel resources: the names in 1006, and the byte lengths of DisplayInfo (1077)