Repository navigation
Use the file time by default for images with GPS but no capture time - #989
Merged
Merged
Conversation
An image with a GPS position of its own but no capture time in its metadata now gets the earlier of its file modification and creation times by default, with a warning and a MapillaryFileTimeWarning in the process report, so that process and process_and_upload take such images without an option. --no_file_time_as_capture_time fails them instead, as before. --use_file_time_as_capture_time is gone: it was never released. video_process still never uses file times: its frames get their times from the video.
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.
Problem
#975 added
--use_file_time_as_capture_timefor images with a GPS position but no capture time, as an opt-in. Without the option such images still fail withUnable to extract timestamp from the image, so a tool that runsprocesswith its defaults, such as the Desktop Uploader, still can't upload them.Change
processandprocess_and_uploadnow give such an image its file time by default: the earlier of its modification and creation times (on Linux, the modification time). It comes with the same warning, and the sameMapillaryFileTimeWarningin the process report, as with the option before.--no_file_time_as_capture_timemakes such an image fail, withUnable to extract timestamp from the image: it has a GPS position but no capture time. Write the capture time into the image (with ExifTool, for example).--use_file_time_as_capture_timeis removed. It was never in a release.video_processnever uses file times.XMP-xmp:CreateDate, still wins over the file time.The cost: a downloaded, exported or copied file has the time of the copy. Such images are uploaded with that date, or fail as too fast when they were copied in one go.
How tested
Two panoramas with GPS and no date:
processfails both (exit 6).processwith no options gives each its file creation time, with one warning each (exit 0). The descriptions are identical to main's with--use_file_time_as_capture_time.--no_file_time_as_capture_time, both fail with the message above.Same results as main for:
XMP-xmp:CreateDate, which keeps that date;--geotag_source gpx, which fails.video_process --no_file_time_as_capture_timeandprocess --use_file_time_as_capture_timeare refused as unknown options.Tests:
video_process);processrun and its report;Each test was checked to fail with its part of the change reverted.
Full suite on Python 3.9 and 3.13, ruff, usort, mypy.