Spaces:
Configuration error
Configuration error
Download frontend/src/utils/convert-image-to-base-64.ts from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 288 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/utils/convert-image-to-base-64.ts
- Command line
-
hf download hf://spaces/flyingdarkdev/README/frontend/src/utils/convert-image-to-base-64.ts
-
curl -L -o convert-image-to-base-64.ts https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/utils/convert-image-to-base-64.ts
288 Bytes
| export const convertImageToBase64 = (file: File): Promise<string> => | |
| new Promise((resolve, reject) => { | |
| const reader = new FileReader(); | |
| reader.onloadend = () => { | |
| resolve(reader.result as string); | |
| }; | |
| reader.onerror = reject; | |
| reader.readAsDataURL(file); | |
| }); | |