From: Jelmer Vernooij Date: Thu, 21 Dec 2017 22:50:21 +0000 (+0100) Subject: m.images: don't display exif tags if there is no exif present. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=db5d322b8d0167d01a80d9d3e4d0fa91539e6268;p=blog.git m.images: don't display exif tags if there is no exif present. --- diff --git a/pelican-plugins/m/images.py b/pelican-plugins/m/images.py index b8e12176..0e7a4e15 100644 --- a/pelican-plugins/m/images.py +++ b/pelican-plugins/m/images.py @@ -185,7 +185,7 @@ class ImageGrid(rst.Directive): im = PIL.Image.open(absuri) # Get EXIF info, if it's there - if hasattr(im, '_getexif'): + if hasattr(im, '_getexif') and im._getexif() is not None: exif = { PIL.ExifTags.TAGS[k]: v for k, v in im._getexif().items()