Fixing the date with GPS time - for beginners

Hi,
Many devices have the tendency to reset their date/time when they lose power for a moment. If you’re not careful, your device will save the pictures as if they were made in 2016. I didn’t find any step by step guide on how to fix this, so I’ll share the steps here.

The gist of it is that you change the original date with a date close to the GPS date/time. For some reason, Mapillary seems to consume metadata dates in this order: DateTime Original > DateTime Digitized > Modify Date > GPS Date/Time
Why the GPS date is taken last is beyond me, as I’d think that is correct by definition.

Anyway, here goes:

  1. Download exiftool
    You can download from exiftool.org, but since I was on a work PC, I used the portable version available at Oliver Betz | Artikel / ExifTool Windows installer and portable package
    Unzip the file in a folder like C:\whereever-you-like\exif tool\

  2. Open a command prompt (hit windows button and start typing “prompt”). Move the active directory by typing:

cd C:\whereever-you-like\exif tool\

(you can paste in the prompt by simply right clicking. You can access previous commands by pushing the “up” key)

  1. See if things work
    For example, let’s start the tool and use it to read the exif data from a single image:

exiftool.exe "g:\mapillary\2016\104GOPRO\G0065843.jpg"

(note: if you actually installed the exiftool, you won’t need to change the directory to the correct place and can just type exiftool, without the .exe)

Part below edited based on the tip of masterofnoroad.

  1. Try it out to fix one image
    The tool won’t just overwrite DateTimeOriginal. So first we empty it.
exiftool -DateTimeOriginal= "G:\test\testimage.jpg"
exiftool "-*Date<FileCreateDate" "G:\test\testimage.jpg"

(Make sure FileCreateDate is correct. In my test image, GPSDateTime was missing. But if you have that data, that’s probably preferred!)

Note that this comment saves a backup of the original image. If you’re satisfied with the result, we can do this in bulk.

  1. Fix everything in a single folder:
exiftool -DateTimeOriginal= "G:\mapillary\202207 ijsland deel 1"
exiftool "-*Date<FileCreateDate" "G:\mapillary\202207 ijsland deel 1"

Note: make sure to not have a \ at the end of the folder description.
If you want to do this for a folder with a bunch of subfolders, add -r
If you do this on a large folder, you’ll have a huge amount of backups to take care of. To avoid that, you can add -overwrite_original to your command.

3 Likes

Please, Mapillary devs, can you change the order as suggested?

My problem for some time is a bug in GoPro timestamp. Long story short GoPro all date and time tags are totally unreliable (like minutes value staying and only seconds change and then well into the next minute updating its value)
Only the GPSDateTime is reliable. The sequences look like this:

My resolution is to do it in two stages, as you wrote exiftool wont just overwrite DateTimeOriginal.
So first to delete it and then to write all tags with “date” in the name with value from GPSDateTime. Maybe not elegant but works for me.

exiftool -DateTimeOriginal= 103GOPRO/
exiftool “-*Date<GPSDateTime” 103GOPRO/

Thanks a lot masterofnoroad, your comment is exactly why I posted this here.

Thank you Joost! We are going to resolve this issue and treat GPS time as the source of truth rather than camera time going forward. @tao will have an update when this fix is incorporated into mapillary_tools and the desktop uploader.

A small warning on using GPS date/time:

  • GPS time isn’t local time, but UTC time or GPS time ( with some leap seconds)
  • The exif GPS date/time metadata usually doesn’t include milliseconds, but it’s possible with DateTimeOriginal + SubSecTimeOriginal tags
1 Like