fix: KeyError['JPG']
This commit is contained in:
parent
342a51920e
commit
56019241ac
1 changed files with 2 additions and 0 deletions
|
|
@ -771,6 +771,8 @@ def image_to_base64(image, extn):
|
|||
from io import BytesIO
|
||||
|
||||
buffered = BytesIO()
|
||||
if extn.lower() == 'jpg':
|
||||
extn = 'JPEG'
|
||||
image.save(buffered, extn)
|
||||
img_str = base64.b64encode(buffered.getvalue())
|
||||
return img_str
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue