Skip to content

Commit

Permalink
omit spurious warnings from files that don't have GPS
Browse files Browse the repository at this point in the history
  • Loading branch information
mceachen committed Oct 5, 2024
1 parent e13fec3 commit 0bc5932
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ vendored versions of ExifTool match the version that they vendor.

## Version history

### v28.4.1

- 📦 The warning "Invalid GPSLatitude or GPSLongitude. Deleting geolocation tags" will only be added if `GPSLatitude` or `GPSLongitude` is non-null.

### v28.4.0

- ✨ Add workaround for abberant Nikon `TimeZone` encoding. Addresses [#215](https://github.com/photostructure/exiftool-vendored.js/issues/215). Set `ExifToolOptions.adjustTimeZoneIfDaylightSavings` to `() => undefined` to retain prior behavior.
Expand Down
9 changes: 6 additions & 3 deletions src/ReadTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,12 @@ export class ReadTask extends ExifToolTask<Tags> {
lon == null ||
(this.options.ignoreZeroZeroLatLon && lat === 0 && lon === 0)
if (this.options.geolocation && invalid) {
this.warnings.push(
"Invalid GPSLatitude or GPSLongitude. Deleting geolocation tags."
)
if (this.#tags.GPSLatitude != null || this.#tags.GPSLongitude != null) {
// don't complain unless there was a GPS value:
this.warnings.push(
"Invalid GPSLatitude or GPSLongitude. Deleting geolocation tags."
)
}
for (const key of Object.keys(this.#raw)) {
const k = this.#tagName(key)
if (k.startsWith("Geolocation")) {
Expand Down

0 comments on commit 0bc5932

Please sign in to comment.