bookcover-3d-web 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/svg.js +5 -1
- package/package.json +1 -1
package/dist/svg.js
CHANGED
|
@@ -36,7 +36,11 @@ export async function svg_to_bitmap(svg, w_pt, h_pt) {
|
|
|
36
36
|
// notably on Safari, this can race and snapshot a blank background.
|
|
37
37
|
// decode() is spec-guaranteed to wait until the image is fully paintable.
|
|
38
38
|
await img.decode();
|
|
39
|
-
|
|
39
|
+
// Must be awaited here (not returned directly) — the blob URL is revoked in
|
|
40
|
+
// `finally` right after this call returns, and on Safari that can race ahead of
|
|
41
|
+
// createImageBitmap still reading from the img element, capturing a blank bitmap.
|
|
42
|
+
const bitmap = await createImageBitmap(img);
|
|
43
|
+
return bitmap;
|
|
40
44
|
}
|
|
41
45
|
finally {
|
|
42
46
|
URL.revokeObjectURL(url);
|