From de1c46ed53671bb5619b59cf5e063e44e2a016ae Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 1 Mar 2021 18:33:14 +0100 Subject: Manage corrupted image - silently fail for now --- ishtar_common/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 977b80ac6..4662bcc35 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -399,8 +399,9 @@ class ImageModel(models.Model, ImageContainerModel): thumb_filename, self.create_thumb(image, self.THUMB_MAX_SIZE), save=False) - except IOError: - pass + except (IOError, ValueError): + self.thumbnail = None + self.image = None finally: if image: image.close() -- cgit v1.2.3