How to fix HTC Tattoo's image timestamp
The bug on the timestamp
The images taken with HTC Tattoo don't show the seconds of the time that the picture was taken. This is buggy as it looks like this "seconds" field is mandatory on the EXIF specification.
This is what the Tattoo writes in the files
Image timestamp 1970:10:15 05:35
This is what should be:
Image timestamp : 1970:10:15 05:35:23
When I moved from F-Spot to Shotwell in my Ubuntu, I noticed that the images weren't being sorted by date as expected. So, I filed a ticket in Shotwell (Exif timestamp not imported from Android), got a positive response, and waited for an answer from them. I suspect that there are other problems with Tattoo that are related to this bug, like this ones: Geo-tag photo not working on Tattoo Timestamp and GPS tags fail to load from HTC Tattoo images
The script to fix the timestamps in images
But then I thought it would be better to actually fix the files, so I spent part of the sundays morning writing a script that does the following:
- Recursively finds JPG images in the specified path.
- Checks if the DateTimeOriginal field in EXIF is missing the seconds field.
- It sets seconds=00 if missing.
How to use the script
sudo apt-get install python-pyexiv2