From 110f7df96243d9c0c6ca705c794a6eac1e3b7bce Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Wed, 14 Sep 2022 08:38:54 +0200 Subject: [PATCH] Fix GIF upload handling --- app/uploads.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/uploads.py b/app/uploads.py index 9946373..60f3151 100644 --- a/app/uploads.py +++ b/app/uploads.py @@ -46,7 +46,7 @@ async def save_upload(db_session: AsyncSession, f: UploadFile) -> models.Upload: width = None height = None - if f.content_type.startswith("image"): + if f.content_type.startswith("image") and not f.content_type == "image/gif": with Image.open(f.file) as _original_image: # Fix image orientation (as we will remove the info from the EXIF # metadata)