From 04ba799d3c8042188ca93ab23eb7bef4835da5ae Mon Sep 17 00:00:00 2001 From: jimnys-8 Date: Thu, 13 Apr 2023 12:28:45 +0200 Subject: [PATCH] Undefined variables in diffusion ditherer The `x` and `y` variables used in `errorDiffusionDither` are never declared in the function, which causes a ReferenceError in strict mode. Not sure if this repo is maintained, but I'll give it a shot anyway! --- lib/algorithms/errorDiffusionDither.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/algorithms/errorDiffusionDither.js b/lib/algorithms/errorDiffusionDither.js index 714e3b1..ae3ab56 100644 --- a/lib/algorithms/errorDiffusionDither.js +++ b/lib/algorithms/errorDiffusionDither.js @@ -7,7 +7,7 @@ function errorDiffusionDither(uint8data, palette, step, h, w) { return (4*x) + (4*y*w); }; - var r, g, b, a, q, i, color, approx, tr, tg, tb, dx, dy, di; + var r, g, b, a, q, x, y, i, color, approx, tr, tg, tb, dx, dy, di; for (y=0;y