Skip to content

Fix exiftool_xml GPS epoch times for per-sample timestamps#823

Merged
ptpt merged 1 commit into
mainfrom
fix-exiftool-xml-gps-epoch-broadcast
Jun 24, 2026
Merged

Fix exiftool_xml GPS epoch times for per-sample timestamps#823
ptpt merged 1 commit into
mainfrom
fix-exiftool-xml-gps-epoch-broadcast

Conversation

@ptpt

@ptpt ptpt commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary

Fixes 4 failing integration tests where the exiftool_xml / exiftool_runtime geotag source produced GPS tracks that diverged from the native source.

Cameras like the GoPro MAX store a single GPSDateTime per sample, shared across all (~17) GPS coordinates in that sample. The exiftool XML parser discarded these timestamps (set epoch_time to None) because the epoch-time count (1) didn't match the coordinate count (~17), while the native parser broadcasts the single sample timestamp to every coordinate.

This caused MAPGPSTrack to contain None epoch times under exiftool_xml but real timestamps under native, failing the exact-equality assertion in assert_descs_exact_equal.

Fix

In _aggregate_epoch_times, when there is exactly one GPS epoch time for multiple coordinates, broadcast it to every coordinate (matching the native parser). Genuine length mismatches (e.g. 3 vs 2) still fall back to None with a warning.

Tests

  • All 52 integration tests pass (previously 4 failing):
    • test_process_geotag_with_exiftool_xml
    • test_process_geotag_with_exiftool_xml_pattern
    • test_process_geotag_everything_with_exiftool_runtime
    • test_process_video_geotag_source_with_exiftool_runtime
  • Updated the unit test that locked in the old discard-on-mismatch behavior to assert the new broadcast behavior, and added a separate case for genuine (3-vs-2) mismatches that still fall back to None.
  • mypy and ruff clean.

Cameras like the GoPro MAX store a single GPSDateTime per sample shared
across all GPS coordinates in that sample. The exiftool XML parser
discarded these timestamps (set epoch_time to None) because the epoch
time count (1) did not match the coordinate count (~17), diverging from
the native parser which broadcasts the single sample timestamp to every
coordinate.

Broadcast a single GPS epoch time to all coordinates so exiftool_xml
output matches native. Genuine mismatches still fall back to None.

Fixes the failing integration tests:
- test_process_geotag_with_exiftool_xml
- test_process_geotag_with_exiftool_xml_pattern
- test_process_geotag_everything_with_exiftool_runtime
- test_process_video_geotag_source_with_exiftool_runtime
@meta-cla meta-cla Bot added the cla signed label Jun 24, 2026
@ptpt ptpt merged commit 81469fc into main Jun 24, 2026
19 checks passed
@ptpt ptpt deleted the fix-exiftool-xml-gps-epoch-broadcast branch June 24, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant