Permalink
Browse files

Merge pull request #316 from IrvinDitz/master

Fix for crash when IPTC reading fails
  • Loading branch information...
saimn committed Mar 19, 2018
2 parents 4cdfb67 + 802ebb7 commit fbdd95295c43edec2c9b2b6b195764d384090e6f
Showing with 11 additions and 5 deletions.
  1. +1 −0 AUTHORS
  2. +10 −5 sigal/gallery.py
@@ -6,6 +6,7 @@ alphabetical order):
- Alexandre Chataignon (@xouillet)
- Alexey Bazhin
- Andreas Sieferlinger
- Andriy Dzedolik (@IrvinDitz)
- Antoine Beaupré
- Antoine Pitrou
- Brent Bandelgar (@brentbb)
@@ -175,11 +175,16 @@ def _get_metadata(self):
# Nothing to do - we already have title and description
return
iptc_data = get_iptc_data(self.src_path)
if not self.title and iptc_data.get('title'):
self.title = iptc_data['title']
if not self.description and iptc_data.get('description'):
self.description = iptc_data['description']
try:
iptc_data = get_iptc_data(self.src_path)
except Exception as e:
self.logger.warning(u'Could not read IPTC data from %s: %s',
self.src_path, e)
else:
if not self.title and iptc_data.get('title'):
self.title = iptc_data['title']
if not self.description and iptc_data.get('description'):
self.description = iptc_data['description']
@cached_property
def raw_exif(self):

0 comments on commit fbdd952

Please sign in to comment.