my fork of the bluesky client
1export const getCanvas = (base64: string): Promise<HTMLCanvasElement> => {
2 return new Promise(resolve => {
3 const image = new Image()
4 image.onload = () => {
5 const canvas = document.createElement('canvas')
6 canvas.width = image.width
7 canvas.height = image.height
8
9 const ctx = canvas.getContext('2d')
10 ctx?.drawImage(image, 0, 0)
11 resolve(canvas)
12 }
13 image.src = base64
14 })
15}