diff --git a/image_cropping/widgets.py b/image_cropping/widgets.py index cce88f05..ad8802cc 100644 --- a/image_cropping/widgets.py +++ b/image_cropping/widgets.py @@ -40,8 +40,16 @@ def get_attrs(image, name): width, height = get_backend().get_size(image) except AttributeError: # invalid image -> AttributeError - width = image.width - height = image.height + try: + width = image.width + height = image.height + except: + width = None + height = None + except Exception as e: + logger.error(e.__str__()) + width = None + height = None return { "class": "crop-thumb", "data-thumbnail-url": thumbnail_url(image),