]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/root-helpers/images.ts
Don't manage remote channels
[github/Chocobozzz/PeerTube.git] / client / src / root-helpers / images.ts
1 function imageToDataURL (input: File | Blob) {
2 return new Promise<string>(res => {
3 const reader = new FileReader()
4
5 reader.onerror = err => console.error('Cannot read input file.', err)
6 reader.onloadend = () => res(reader.result as string)
7 reader.readAsDataURL(input)
8 })
9 }
10
11 export {
12 imageToDataURL
13 }