next-blurhash-previews 0.0.3-beta70 → 0.0.3-beta71
Sign up to get free protection for your applications and to get access to all the features.
@@ -84,6 +84,26 @@ function updateBlurHashPreview(canvasEl: HTMLCanvasElement, preview: blurhash) {
|
|
84
84
|
|
85
85
|
if (true) {
|
86
86
|
const worker = new Worker(window.URL.createObjectURL(workerBlob));
|
87
|
+
|
88
|
+
const s = +new Date();
|
89
|
+
|
90
|
+
const emptyCanv = document
|
91
|
+
.createElement("canvas")
|
92
|
+
// @ts-ignore
|
93
|
+
.transferControlToOffscreen();
|
94
|
+
|
95
|
+
worker.postMessage(
|
96
|
+
{
|
97
|
+
canvas: emptyCanv,
|
98
|
+
width: 50,
|
99
|
+
height: 50,
|
100
|
+
blurhash: "L05E$[offQofoffQfQfQfQfQfQfQ",
|
101
|
+
},
|
102
|
+
[emptyCanv]
|
103
|
+
);
|
104
|
+
const e = +new Date();
|
105
|
+
console.log("bootstrap", e - s);
|
106
|
+
|
87
107
|
const offscreen = (canvasEl as any).transferControlToOffscreen();
|
88
108
|
worker.postMessage({ canvas: offscreen, width, height, blurhash }, [
|
89
109
|
offscreen,
|
package/imagePreviewBootstrap.js
CHANGED
@@ -289,6 +289,16 @@ function updateBlurHashPreview(canvasEl, preview) {
|
|
289
289
|
canvasEl.height = height;
|
290
290
|
{
|
291
291
|
const worker = new Worker(window.URL.createObjectURL(workerBlob));
|
292
|
+
const s = +new Date();
|
293
|
+
const emptyCanv = document.createElement("canvas").transferControlToOffscreen();
|
294
|
+
worker.postMessage({
|
295
|
+
canvas: emptyCanv,
|
296
|
+
width: 50,
|
297
|
+
height: 50,
|
298
|
+
blurhash: "L05E$[offQofoffQfQfQfQfQfQfQ"
|
299
|
+
}, [emptyCanv]);
|
300
|
+
const e = +new Date();
|
301
|
+
console.log("bootstrap", e - s);
|
292
302
|
const offscreen = canvasEl.transferControlToOffscreen();
|
293
303
|
worker.postMessage({
|
294
304
|
canvas: offscreen,
|