From dced90eb4d745ab08e94ff829ffd2ae17ca1de64 Mon Sep 17 00:00:00 2001 From: Anri Kennel Date: Fri, 22 Sep 2023 12:44:24 +0200 Subject: [PATCH] Actualiser custom.js --- custom.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/custom.js b/custom.js index b2baf03..e084e1e 100644 --- a/custom.js +++ b/custom.js @@ -61,7 +61,12 @@ const svgObsidianFix = () => { canvas.height = image.height; const ctx = canvas.getContext("2d"); ctx.drawImage(image, 0, 0); - const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); + const imageData = ctx.getImageData( + 0, + 0, + Math.max(1, canvas.width), + Math.max(1, canvas.height) + ); const pixelData = imageData.data; const colors = [];