(dataURL: string)
| 380 | } |
| 381 | |
| 382 | export async function tryConvertDataURLToBlobURL(dataURL: string): Promise<string | null> { |
| 383 | if (!isBlobURLSupported) { |
| 384 | return null; |
| 385 | } |
| 386 | const hash = getHashCode(dataURL); |
| 387 | let blobURL = dataURLBlobURLs.get(hash); |
| 388 | if (blobURL) { |
| 389 | return blobURL; |
| 390 | } |
| 391 | |
| 392 | let blob = tryConvertDataURLToBlobSync(dataURL); |
| 393 | if (!blob) { |
| 394 | const response = await fetch(dataURL); |
| 395 | blob = await response.blob(); |
| 396 | } |
| 397 | |
| 398 | blobURL = URL.createObjectURL(blob); |
| 399 | dataURLBlobURLs.set(hash, blobURL); |
| 400 | return blobURL; |
| 401 | } |
| 402 | |
| 403 | export function cleanImageProcessingCache(): void { |
| 404 | imageManager && imageManager.stop(); |
no test coverage detected