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()