From 05eeada23bd7065bf750e88c4c3125676e9ace92 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 27 Feb 2018 15:47:32 +0100 Subject: Allow no resizing of images (by explicit parameter in settings) --- ishtar_common/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index f482cf61d..6f8a66f3b 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -896,9 +896,10 @@ class ImageModel(models.Model): image = image.convert('RGB') # resize if necessary - self.image.save(filename, - self.create_thumb(image, self.IMAGE_MAX_SIZE), - save=False) + if self.IMAGE_MAX_SIZE: + self.image.save(filename, + self.create_thumb(image, self.IMAGE_MAX_SIZE), + save=False) if old_path != self.image.path: try: -- cgit v1.2.3