Format the tree the way the gate asks for it
`cargo fmt --check` is a required step and had drifted across 45 files. Most of it arrived this week: several operations were written in parallel worktrees and merged by hand, and a hand-merge resolves conflicts without ever running the formatter over the result. No behaviour changes — this is `cargo fmt --all` and nothing else, kept as its own commit so the next reader can skip it wholesale rather than search it for one that matters. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -77,9 +77,7 @@ pub fn encode(
|
||||
.map(|m| m.sanitised(settings.strip_location));
|
||||
// JPEG and PNG take a finished block; TIFF writes the tags into its own
|
||||
// directory and needs the fields.
|
||||
let block = carried
|
||||
.as_ref()
|
||||
.and_then(|m| exif::block(m, width, height));
|
||||
let block = carried.as_ref().and_then(|m| exif::block(m, width, height));
|
||||
|
||||
match settings.format {
|
||||
ExportFormat::Jpeg => jpeg(
|
||||
@@ -303,8 +301,11 @@ where
|
||||
W: std::io::Write + std::io::Seek,
|
||||
K: tiff::encoder::TiffKind,
|
||||
{
|
||||
dir.write_tag(tiff::tags::Tag::Unknown(TAG_ICC_PROFILE), Undefined(profile))
|
||||
.map_err(|e| ExportError::Encode(e.to_string()))
|
||||
dir.write_tag(
|
||||
tiff::tags::Tag::Unknown(TAG_ICC_PROFILE),
|
||||
Undefined(profile),
|
||||
)
|
||||
.map_err(|e| ExportError::Encode(e.to_string()))
|
||||
}
|
||||
|
||||
/// TRACES: FR-EXP-8
|
||||
@@ -376,7 +377,10 @@ where
|
||||
)?;
|
||||
}
|
||||
if let Some(f) = md.aperture.filter(|f| *f > 0.0) {
|
||||
dir.write_tag(Tag::Unknown(exif::tag::FNUMBER), Rationals(&[exif::tenths(f)]))?;
|
||||
dir.write_tag(
|
||||
Tag::Unknown(exif::tag::FNUMBER),
|
||||
Rationals(&[exif::tenths(f)]),
|
||||
)?;
|
||||
}
|
||||
if let Some(f) = md.focal_length.filter(|f| *f > 0.0) {
|
||||
dir.write_tag(
|
||||
@@ -935,11 +939,16 @@ mod tests {
|
||||
assert_eq!(md.aperture, Some(2.8), "{format:?}");
|
||||
assert_eq!(md.focal_length, Some(85.0), "{format:?}");
|
||||
|
||||
let loc = md.location.unwrap_or_else(|| panic!("{format:?} lost the fix"));
|
||||
let loc = md
|
||||
.location
|
||||
.unwrap_or_else(|| panic!("{format:?} lost the fix"));
|
||||
// Within a metre of where it started, which is finer than any
|
||||
// consumer receiver and far finer than the tag's own rounding.
|
||||
assert!((loc.latitude - LATITUDE).abs() < 1e-5, "{format:?} {loc:?}");
|
||||
assert!((loc.longitude - LONGITUDE).abs() < 1e-5, "{format:?} {loc:?}");
|
||||
assert!(
|
||||
(loc.longitude - LONGITUDE).abs() < 1e-5,
|
||||
"{format:?} {loc:?}"
|
||||
);
|
||||
assert_eq!(loc.altitude, Some(35.0), "{format:?}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user