Browse Source

Updated IPTC fix with try-else block

pull/316/head
Andriy Dzedolik 8 years ago
parent
commit
802ebb7526
  1. 1
      AUTHORS
  2. 9
      sigal/gallery.py

1
AUTHORS

@ -6,6 +6,7 @@ alphabetical order):
- Alexandre Chataignon (@xouillet)
- Alexey Bazhin
- Andreas Sieferlinger
- Andriy Dzedolik (@IrvinDitz)
- Antoine Beaupré
- Antoine Pitrou
- Brent Bandelgar (@brentbb)

9
sigal/gallery.py

@ -180,10 +180,11 @@ class Image(Media):
except Exception as e:
self.logger.warning(u'Could not read IPTC data from %s: %s',
self.src_path, e)
if not self.title and 'iptc_data' in locals() and iptc_data.get('title'):
self.title = iptc_data['title']
if not self.description and 'iptc_data' in locals() and iptc_data.get('description'):
self.description = iptc_data['description']
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):

Loading…
Cancel
Save