X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ae60b2a3949e96357477cc04f90fd0873cee8a92..967eed676fc83d15b26149047f353ac61faa8217:/src/picture/templatetags/picture_tags.py?ds=sidebyside diff --git a/src/picture/templatetags/picture_tags.py b/src/picture/templatetags/picture_tags.py index b31405b8d..973d862f9 100644 --- a/src/picture/templatetags/picture_tags.py +++ b/src/picture/templatetags/picture_tags.py @@ -55,7 +55,9 @@ def area_thumbnail_url(area, geometry): area.picture.image_file, geometry, crop="%dpx %dpx %dpx %dpx" % tuple(map(lambda d: max(0, d), tuple(coords[0] + coords[1])))) - except Exception, e: + except ZeroDivisionError: + return '' + except Exception as e: logging.exception("Error creating a thumbnail for PictureArea") return ''