summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2021-03-01 18:33:14 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-03-01 18:34:48 +0100
commit2781b537fc64b454cea5c88b3e19000cf8c7cee8 (patch)
treee0c5c21b33052ce7a20e027cd29d6989637cc12f /ishtar_common/models.py
parenta456cce506cbbcffb86bb150540e14df26fe604b (diff)
downloadIshtar-2781b537fc64b454cea5c88b3e19000cf8c7cee8.tar.bz2
Ishtar-2781b537fc64b454cea5c88b3e19000cf8c7cee8.zip
Manage corrupted image - silently fail for now
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py5
1 files changed, 3 insertions, 2 deletions
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()