From 9cd892e8dd793e346aab3656e92d30f4584eb8f8 Mon Sep 17 00:00:00 2001 From: lilyissillyyy Date: Sat, 6 Sep 2025 00:18:11 -0400 Subject: [PATCH] Fix --- commands/analyze/read-qr-code.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/analyze/read-qr-code.js b/commands/analyze/read-qr-code.js index 6262a3cd..ef22f49b 100644 --- a/commands/analyze/read-qr-code.js +++ b/commands/analyze/read-qr-code.js @@ -24,8 +24,9 @@ module.exports = class ReadQRCodeCommand extends Command { async run(msg, { image }) { const { body } = await request.get(image); const img = await loadImage(body); - const canvas = createCanvas(img); + const canvas = createCanvas(img.height, img.width); const ctx = canvas.getContext('2d'); + ctx.drawImage(img, 0, 0); const imgData = ctx.getImageData(0, 0, img.width, img.height); try { const result = await this.readQrCode(imgData);