Some jpgs are recognized as MPO (basically jpg with additional data

This commit is contained in:
Oliver Falk
2022-11-30 11:50:29 +01:00
parent 64575a9b99
commit 9dceb7a696

View File

@@ -41,7 +41,7 @@ def file_format(image_type):
""" """
Helper method returning a short image type Helper method returning a short image type
""" """
if image_type == "JPEG": if image_type in ("JPEG", "MPO"):
return "jpg" return "jpg"
elif image_type == "PNG": elif image_type == "PNG":
return "png" return "png"
@@ -54,7 +54,7 @@ def pil_format(image_type):
""" """
Helper method returning the 'encoder name' for PIL 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" return "JPEG"
elif image_type == "png": elif image_type == "png":
return "PNG" return "PNG"