Skip to content

Commit

Permalink
Merge pull request #1420 from pierotofy/structfix
Browse files Browse the repository at this point in the history
Catch piexif.dump exceptions
  • Loading branch information
pierotofy committed Oct 22, 2023
2 parents 918ec48 + bcc0f24 commit 6bc9002
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import shutil
import time
import struct
import uuid as uuid_module
from app.vendor import zipfly

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 6bc9002

Please sign in to comment.