Sometimes exif strings are null terminated, and python imagining library doesn't deal with that for us.

This commit is contained in:
Jason A. Donenfeld 2012-03-29 15:42:53 +02:00
parent 6f11e0526e
commit 836503156d

View File

@ -146,7 +146,7 @@ class Photo(object):
for tag, value in info.items():
decoded = TAGS.get(tag, tag)
if isinstance(value, str):
value = value.strip()
value = value.strip().partition("\x00")[0]
if isinstance(decoded, str) and decoded.startswith("DateTime"):
try:
value = datetime.strptime(value, '%Y:%m:%d %H:%M:%S')