MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / image_to_base64

Function image_to_base64

scripts/server/post_multi_servers.py:12–16  ·  view source on GitHub ↗

Convert an image file to base64 string

(image_path)

Source from the content-addressed store, hash-verified

10from tqdm import tqdm
11
12
13def image_to_base64(image_path):
14 """Convert an image file to base64 string"""
15 with open(image_path, "rb") as f:
16 image_data = f.read()
17 return base64.b64encode(image_data).decode("utf-8")
18
19

Callers 1

process_image_pathFunction · 0.70

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected