Date time bug.

This commit is contained in:
Jason A. Donenfeld 2011-05-07 03:00:06 -04:00
parent 07369da4aa
commit d51f298102

View File

@ -144,7 +144,7 @@ class Photo(object):
try: try:
value = datetime.strptime(value, '%Y:%m:%d %H:%M:%S') value = datetime.strptime(value, '%Y:%m:%d %H:%M:%S')
except: except:
pass continue
exif[decoded] = value exif[decoded] = value
if "Orientation" in exif: if "Orientation" in exif:
@ -260,9 +260,9 @@ class Photo(object):
if not self.is_valid: if not self.is_valid:
return datetime(1900, 1, 1) return datetime(1900, 1, 1)
if "DateTimeOriginal" in self._attributes: if "DateTimeOriginal" in self._attributes:
return self._attributes["DateTimeOriginal"] return self._attributes["dateTimeOriginal"]
elif "DateTime" in self._attributes: elif "DateTime" in self._attributes:
return self._attributes["DateTime"] return self._attributes["dateTime"]
else: else:
return self._attributes["dateTimeFile"] return self._attributes["dateTimeFile"]
def __cmp__(self, other): def __cmp__(self, other):