X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/357027375ff8867f42ca34bcbfb5a78b5b185fc3..d8dd5e33408239d7fb7b0e14199de1a8341b9858:/src/picture/templatetags/picture_tags.py diff --git a/src/picture/templatetags/picture_tags.py b/src/picture/templatetags/picture_tags.py index 02d80b005..a766b44d9 100644 --- a/src/picture/templatetags/picture_tags.py +++ b/src/picture/templatetags/picture_tags.py @@ -18,6 +18,7 @@ register = template.Library() cropper = CustomCroppingEngine() + @register.inclusion_tag('picture/picture_wide.html', takes_context=True) def picture_wide(context, picture): context.update({ @@ -54,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 ''