Skip to content

Commit

Permalink
fix for issue #131: GPS lat/lon refs
Browse files Browse the repository at this point in the history
  • Loading branch information
mceachen committed Feb 13, 2023
1 parent cd897a7 commit 174b25f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"luxon": "^3.2.1"
},
"optionalDependencies": {
"exiftool-vendored.exe": "12.50.0",
"exiftool-vendored.pl": "12.50.0"
"exiftool-vendored.exe": "12.56.0",
"exiftool-vendored.pl": "12.56.0"
}
}
11 changes: 11 additions & 0 deletions src/WriteTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ export class WriteTask extends ExifToolTask<void> {
return new VersionTask() as any
}

// Special handling for GPSLatitude and GPSLongitude (due to differences
// in EXIF, XMP, and MIE encodings). See
// https://exiftool.org/forum/index.php?topic=14488.0 and
// https://github.com/photostructure/exiftool-vendored.js/issues/131
if (isNumber(tags.GPSLatitude)) {
tags.GPSLatitudeRef ??= tags.GPSLatitude >= 0 ? "N" : "S"
}
if (isNumber(tags.GPSLongitude)) {
tags.GPSLongitudeRef ??= tags.GPSLongitude >= 0 ? "E" : "W"
}

for (const key of keys(tags)) {
const val = tags[key]
args.push(`-${key}=${enc(val)}`)
Expand Down

0 comments on commit 174b25f

Please sign in to comment.