exif: preserve filesystem mtime on GPS write

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) <noreply@anthropic.com>
This commit is contained in:
Cameron Cordes
2026-05-04 16:09:21 -04:00
parent 82dd21b205
commit 1ddbca3413

View File

@@ -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))