Get base64 string from image URI.
(image_path: str)
| 3 | |
| 4 | |
| 5 | def encode_image(image_path: str) -> str: |
| 6 | """Get base64 string from image URI.""" |
| 7 | with open(image_path, "rb") as image_file: |
| 8 | return base64.b64encode(image_file.read()).decode("utf-8") |
| 9 | |
| 10 | |
| 11 | def image_to_data_url(image_path: str) -> str: |
no test coverage detected