mirror of
https://github.com/owncast/owncast.git
synced 2024-12-24 18:18:24 +03:00
8 lines
309 B
TypeScript
8 lines
309 B
TypeScript
|
export const ACCEPTED_IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif'];
|
||
|
|
||
|
export function getBase64(img: File | Blob, callback: (imageUrl: string | ArrayBuffer) => void) {
|
||
|
const reader = new FileReader();
|
||
|
reader.addEventListener('load', () => callback(reader.result));
|
||
|
reader.readAsDataURL(img);
|
||
|
}
|