Edukira salto egin | Salto egin nabigazioara

Tresna pertsonalak

Eibarko peoria, San Blasa baino hobia
Hemen zaude: Hasiera / Blogak / Teknosexua

Ikasitakoa desikasten ikasten

How to fix HTC Tattoo's image timestamp

Gari Araolaza 2011/02/23 06:49
HTC Tattoo's photo timestamps are buggy, the field is incorrect, so your photo managing software might not recognize when did you take them. I wrote a script to correct this bug in your images.

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.
And that's all!

How to use the script

The script is called exifseconds,py and it's written in Python. You will need the pyexiv2 library installed on your system. It accepts only one parameter, which is the path where you have your buggy images.
You can download the script here:
Dependencies: You will need pyexiv2 library installed on your system to run it. so in Ubuntu, do
sudo apt-get install python-pyexiv2
Usage:  python <PATH_TO_FIX_FILES>
Thanks for any feedback!

naiz. Teknogauza guzti hauetaz idazteko sortu nuen bloga, baina orain gai eta maiztasun librean nabil.