Catch piexif.dump exceptions

pull/1420/head
Piero Toffanin 2023-10-22 13:23:21 -04:00
rodzic 918ec48e6d
commit bcc0f24fd5
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -2,6 +2,7 @@ import logging
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()