Test / backend /services /utils.py
UKielz's picture
Upload 14 files
0bbe8e9 verified
raw
history blame contribute delete
248 Bytes
import base64
from io import BytesIO
from PIL import Image
def validate_image_base64(image_base64: str) -> bool:
try:
Image.open(BytesIO(base64.b64decode(image_base64)))
return True
except:
return False