fix: Handle jpe files in image_to_base64

This commit is contained in:
Faris Ansari 2020-09-14 15:21:22 +00:00
parent 7a31983c90
commit 627aff4bb8

View file

@ -788,7 +788,7 @@ def image_to_base64(image, extn):
from io import BytesIO
buffered = BytesIO()
if extn.lower() == 'jpg':
if extn.lower() in ('jpg', 'jpe'):
extn = 'JPEG'
image.save(buffered, extn)
img_str = base64.b64encode(buffered.getvalue())