From bcc0f24fd5061407af4e4aef48882836d2e86fd8 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Sun, 22 Oct 2023 13:23:21 -0400 Subject: [PATCH] Catch piexif.dump exceptions --- app/models/task.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/task.py b/app/models/task.py index 89bcb85c0..7bbe24e56 100644 --- a/app/models/task.py +++ b/app/models/task.py @@ -2,6 +2,7 @@ import os import shutil import time +import struct import uuid as uuid_module from app.vendor import zipfly @@ -157,7 +158,7 @@ def resize_image(image_path, resize_to, done=None): os.rename(resized_image_path, image_path) logger.info("Resized {} to {}x{}".format(image_path, resized_width, resized_height)) - except (IOError, ValueError) as e: + except (IOError, ValueError, struct.error) as e: logger.warning("Cannot resize {}: {}.".format(image_path, str(e))) if done is not None: done()