From b79a206b79a5e805ad06f9103977e19589b66758 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Fri, 21 Jul 2017 12:29:03 +0200 Subject: [PATCH] skip logging ZeroDivisionError on negative text areas --- src/picture/templatetags/picture_tags.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/picture/templatetags/picture_tags.py b/src/picture/templatetags/picture_tags.py index b31405b8d..a766b44d9 100644 --- a/src/picture/templatetags/picture_tags.py +++ b/src/picture/templatetags/picture_tags.py @@ -55,6 +55,8 @@ 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 ZeroDivisionError: + return '' except Exception, e: logging.exception("Error creating a thumbnail for PictureArea") return '' -- 2.20.1