From 4b097a0d15fc8534fa692efe2309a6a7209ed6a3 Mon Sep 17 00:00:00 2001 From: CrispyBaguette Date: Sun, 12 Dec 2021 18:07:58 +0100 Subject: [PATCH] Moved Ditherer to other folder --- client/src/{ => lib}/Ditherer.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) rename client/src/{ => lib}/Ditherer.ts (95%) diff --git a/client/src/Ditherer.ts b/client/src/lib/Ditherer.ts similarity index 95% rename from client/src/Ditherer.ts rename to client/src/lib/Ditherer.ts index 4bed76a..2351227 100644 --- a/client/src/Ditherer.ts +++ b/client/src/lib/Ditherer.ts @@ -2,8 +2,11 @@ class Ditherer { async dither(image: Uint8ClampedArray): Promise { const worker: any = await wasmWorker("/main.wasm"); let output: Uint8ClampedArray; - output = await worker.dither(image); - worker.terminate(); + try { + output = await worker.dither(image); + } finally { + worker.terminate(); + } return output; } }