peircej / jbrout

Automatically exported from code.google.com/p/jbrout
0 stars 0 forks source link

"try to correct exif date if wrong" is not working properly for dates < 1900 #162

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Importing an image with an out of bounds exif date time crashes jbrot. This is 
due to the strange "try to correct exif date if wrong" thing in 
PhotoCmd.__init__:

Instead of using strftime and checking if an exception is thrown, I suggest 
doing something like:

isDateExifOk=False
try:
    exif_date_time = self.__info["Exif.Photo.DateTimeOriginal"]
    if isinstance(self.__info["Exif.Photo.DateTimeOriginal"], datetime):
        isDateExifOk=True
    else:
        isDateExifOk=False
except KeyError:        # tag exif datetime not present
    isDateExifOk=False

Original issue reported on code.google.com by florian....@gmail.com on 27 Aug 2010 at 8:34

GoogleCodeExporter commented 8 years ago
Sure ?
I can't reproduce this with a picture dated in 1962 ...
Perhaps a recent patch corrected this issue
I close it

You can reopen ...

Original comment by manat...@gmail.com on 12 Oct 2010 at 7:01