next-blurhash-previews 0.0.3-beta68 → 0.0.3-beta70
Sign up to get free protection for your applications and to get access to all the features.
package/bin/generateBlurhash.js
CHANGED
@@ -76,7 +76,6 @@ const workerBlob = new Blob(
|
|
76
76
|
[document.querySelector("#next-blurhash-worker-script")!.textContent!],
|
77
77
|
{ type: "text/javascript" }
|
78
78
|
);
|
79
|
-
const worker = new Worker(window.URL.createObjectURL(workerBlob));
|
80
79
|
|
81
80
|
function updateBlurHashPreview(canvasEl: HTMLCanvasElement, preview: blurhash) {
|
82
81
|
const { w: width, h: height, blurhash } = preview;
|
@@ -84,6 +83,7 @@ function updateBlurHashPreview(canvasEl: HTMLCanvasElement, preview: blurhash) {
|
|
84
83
|
canvasEl.height = height;
|
85
84
|
|
86
85
|
if (true) {
|
86
|
+
const worker = new Worker(window.URL.createObjectURL(workerBlob));
|
87
87
|
const offscreen = (canvasEl as any).transferControlToOffscreen();
|
88
88
|
worker.postMessage({ canvas: offscreen, width, height, blurhash }, [
|
89
89
|
offscreen,
|
package/imagePreviewBootstrap.js
CHANGED
@@ -279,7 +279,6 @@ if (!customElements.get("blurhash-image")) {
|
|
279
279
|
const workerBlob = new Blob([document.querySelector("#next-blurhash-worker-script").textContent], {
|
280
280
|
type: "text/javascript"
|
281
281
|
});
|
282
|
-
const worker = new Worker(window.URL.createObjectURL(workerBlob));
|
283
282
|
function updateBlurHashPreview(canvasEl, preview) {
|
284
283
|
const {
|
285
284
|
w: width,
|
@@ -289,6 +288,7 @@ function updateBlurHashPreview(canvasEl, preview) {
|
|
289
288
|
canvasEl.width = width;
|
290
289
|
canvasEl.height = height;
|
291
290
|
{
|
291
|
+
const worker = new Worker(window.URL.createObjectURL(workerBlob));
|
292
292
|
const offscreen = canvasEl.transferControlToOffscreen();
|
293
293
|
worker.postMessage({
|
294
294
|
canvas: offscreen,
|