From 1ddbca3413516b21022a0cfaa5b23fb61e13e4bb Mon Sep 17 00:00:00 2001 From: Cameron Cordes Date: Mon, 4 May 2026 16:09:21 -0400 Subject: [PATCH] exif: preserve filesystem mtime on GPS write MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pass -P to exiftool so write_gps doesn't bump the file's modification time. For phone photos with no embedded EXIF datetime, the filesystem mtime is often the only timestamp we have — losing it on every GPS backfill would be data loss. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/exif.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/exif.rs b/src/exif.rs index 4470f50..f15ef6f 100644 --- a/src/exif.rs +++ b/src/exif.rs @@ -188,6 +188,7 @@ pub fn write_gps(path: &Path, lat: f64, lon: f64) -> Result<()> { let lon_abs = lon.abs(); let output = Command::new("exiftool") .arg("-overwrite_original") + .arg("-P") .arg(format!("-GPSLatitude={}", lat_abs)) .arg(format!("-GPSLatitudeRef={}", lat_ref)) .arg(format!("-GPSLongitude={}", lon_abs))