Fix uploaded photos saved as empty files after Pillow verify()

This commit is contained in:
krek0 2026-05-07 13:49:03 +02:00
parent 5d0ea49318
commit 2c83801924

View file

@ -311,6 +311,7 @@ class GalleryUpload(PermissionRequiredMixin, FormView):
try:
opened = Image.open(photo_file)
opened.verify()
photo_file.seek(0)
except Exception:
# Pillow doesn't recognize it as an image, skip it
messages.error(