Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions image_cropping/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down