From 9dceb7a69644a3b9d8a95a78ada09aefed45f81c Mon Sep 17 00:00:00 2001 From: Oliver Falk Date: Wed, 30 Nov 2022 11:50:29 +0100 Subject: [PATCH] Some jpgs are recognized as MPO (basically jpg with additional data --- ivatar/ivataraccount/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ivatar/ivataraccount/models.py b/ivatar/ivataraccount/models.py index 689fd8a..c69830b 100644 --- a/ivatar/ivataraccount/models.py +++ b/ivatar/ivataraccount/models.py @@ -41,7 +41,7 @@ def file_format(image_type): """ Helper method returning a short image type """ - if image_type == "JPEG": + if image_type in ("JPEG", "MPO"): return "jpg" elif image_type == "PNG": return "png" @@ -54,7 +54,7 @@ def pil_format(image_type): """ Helper method returning the 'encoder name' for PIL """ - if image_type == "jpg" or image_type == "jpeg": + if image_type in ("jpg", "jpeg", "mpo"): return "JPEG" elif image_type == "png": return "PNG"