Creation date of some .jpg files cannot be parsed
The creation date of
jpg files shooted with the camera of a friend's android phone cannot be parsed by hachoir. See for example this image (of an on-time clock).
I expect the following python interactive shell session to display the datetime creation, but it fails.
$ python Python 2.7.11 (default, Dec 9 2015, 00:29:25) [GCC 5.3.1 20151205] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from hachoir_core.cmd_line import unicodeFilename >>> from hachoir_metadata import extractMetadata >>> from hachoir_parser import createParser >>> photo = "IMG_20151218_174010_282.jpg" >>> meta = extractMetadata(createParser(unicodeFilename(photo), photo)) [warn] Error when calling function readGPS(): Can't get field "value_entry" from /exif/content/ifd [warn] Unable to convert creation_date=u'2015:12:18 16:40:9' (unicode) to datetime or date [warn] [/exif/content/ifd] [Autofix] Delete '/exif/content/ifd/padding' (too large) [warn] [/exif/content/ifd] [Autofix] Fix parser error: stop parser, add padding >>> meta.get('creation_date') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/dist-packages/hachoir_metadata/metadata.py", line 82, in get raise ValueError("Metadata has no value '%s' (index %s)" % (key, index)) ValueError: Metadata has no value 'creation_date' (index 0) >>>
Two things to notice:
- hachoir cannot get the creation date, although it is stored in the file: nautilus, or
exifread, for instance, are able to see it.
- the warning
Unable to convert creation_date=u'2015:12:18 16:40:9' (unicode) to datetime or dateshows a wrong creation date: the date is correct, but the time should be 17:40 (as pictured) instead of 16:40. This looks like a time zone issue (this is a French phone).
I can provide additional images or information about the phone on request.