Skip to content
This repository has been archived by the owner on May 10, 2019. It is now read-only.

Commit

Permalink
add protection for unexpected EXIF info
Browse files Browse the repository at this point in the history
  • Loading branch information
richq committed Sep 17, 2016
1 parent a88857e commit 0b73505
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions f2flickr/uploadr.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,11 @@ def uploadImage( self, image ):
if XPKEYWORDS in exiftags:
printable = exiftags[XPKEYWORDS].printable
if len(printable) > 4:
exifstring = exifread.make_string(eval(printable))
picTags += exifstring.replace(';', ' ')
try:
exifstring = exifread.make_string(eval(printable))
picTags += exifstring.replace(';', ' ')
except:
logging.exception("Skipping unexpected EXIF data in %s", image)

picTags = picTags.strip()
logging.info("Uploading image %s with tags %s", image, picTags)
Expand Down Expand Up @@ -529,7 +532,7 @@ def uploadImage( self, image ):
self.abandonUploads = True
return None
except:
logging.exception("Upload failed")
logging.exception("Upload failed %s", image)
return None


Expand Down

0 comments on commit 0b73505

Please sign in to comment.