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

master
Jason A. Donenfeld 2012-03-29 15:42:53 +02:00
parent 6f11e0526e
commit 836503156d
1 changed files with 1 additions and 1 deletions

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')