(canvas: ImageCacheCanvas)
| 89 | } |
| 90 | |
| 91 | async function canvasToPngUrl(canvas: ImageCacheCanvas): Promise<string | null> { |
| 92 | const blob = isOffscreenCanvas(canvas) |
| 93 | ? await canvas.convertToBlob({ type: 'image/png' }) |
| 94 | : await new Promise<Blob | null>((resolve) => canvas.toBlob(resolve, 'image/png')); |
| 95 | return blob ? URL.createObjectURL(blob) : null; |
| 96 | } |
| 97 | |
| 98 | async function loadMaskedThumbnail(imageFile: File, maskFile: File, inverseMask: boolean): Promise<string | null> { |
| 99 | try { |
no test coverage detected