File size: 228 Bytes
e0f406c
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
import base64

def encode_image(image_path):
    if image_path:
        with open(image_path, "rb") as image_file:
            return base64.b64encode(image_file.read()).decode('utf-8')
    else:
        return "No image inputs"