mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user