Fix exiftool_xml GPS epoch times for per-sample timestamps#823
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 4 failing integration tests where the
exiftool_xml/exiftool_runtimegeotag source produced GPS tracks that diverged from thenativesource.Cameras like the GoPro MAX store a single
GPSDateTimeper sample, shared across all (~17) GPS coordinates in that sample. The exiftool XML parser discarded these timestamps (setepoch_timetoNone) 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
MAPGPSTrackto containNoneepoch times underexiftool_xmlbut real timestamps undernative, failing the exact-equality assertion inassert_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 toNonewith a warning.Tests
test_process_geotag_with_exiftool_xmltest_process_geotag_with_exiftool_xml_patterntest_process_geotag_everything_with_exiftool_runtimetest_process_video_geotag_source_with_exiftool_runtimeNone.mypyandruffclean.