File size: 248 Bytes
0bbe8e9
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
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