Skip to content

Use ExifTool's Geolocation API if supported.#481

Closed
jmathai wants to merge 1 commit into
masterfrom
exiftool-geolocation-gh-467
Closed

Use ExifTool's Geolocation API if supported.#481
jmathai wants to merge 1 commit into
masterfrom
exiftool-geolocation-gh-467

Conversation

@jmathai
Copy link
Copy Markdown
Owner

@jmathai jmathai commented Jun 18, 2025

  • ExifTool geolocation as MapQuest alternative when no API key is configured
  • Comprehensive unit tests
  • Proper fallback behavior
  • Priority order: MapQuest (if key exists) → ExifTool → Unknown Location

  - ExifTool geolocation as MapQuest alternative when no API key is configured
  - Comprehensive unit tests
  - Proper fallback behavior
  - Priority order: MapQuest (if key exists) → ExifTool → Unknown Location
@jmathai jmathai closed this Oct 27, 2025
@jmathai jmathai deleted the exiftool-geolocation-gh-467 branch October 27, 2025 02:22
vesaias added a commit to vesaias/elodie that referenced this pull request Apr 25, 2026
Two related fixes for the new ExifTool reverse-geolocation flow added in
PR jmathai#481/jmathai#505 so paths like `%date %country` resolve correctly end-to-end:

1. geolocation.py: accept both prefixed and bare exiftool keys.
   `is_exiftool_available`, `exiftool_coordinates_by_name`, and
   `exiftool_place_name` only matched `ExifTool:GeolocationCity`/etc.,
   missing the bare `GeolocationCity` form that exiftool returns when
   the `-G` group flag is not in effect. A new helper `_geolocation_field`
   transparently tries both forms.

2. filesystem.py: expand sub-key aliases inside `%custom` templates.
   `get_dynamic_path` for `custom` recursively dispatched each `%foo`
   token but passed the literal `%foo` as the mask, ignoring the
   `[Directory]` config alias. As a result, configurations like

       location=%country
       custom=%date %location
       full_path=%custom

   resolved `%location` to `place_name['default']` (the city, since
   exiftool_place_name sets default to the most-specific field) instead
   of expanding via the `location=%country` alias. The custom resolver
   now substitutes the alias value before recursing, mirroring the
   top-level path resolver.

Tests:
- 4 new geolocation tests cover both bare and prefixed key forms in
  is_exiftool_available, exiftool_coordinates_by_name, and
  exiftool_place_name.
- 1 new filesystem test exercises the `%custom` -> `%location` ->
  `%country` expansion chain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant