We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, from the decode result, I want to crop the qroce from the image, next is my code:
Jimp.read(buffer) .then(function (blockimg) { var width = blockimg.bitmap.width, height = blockimg.bitmap.height, imgData = blockimg.bitmap.data; var code = jsqr(imgData, width, height); if (code) { console.log(code); Jimp.read(buffer).then((image) => { const cropMeta = { x: code.location.topLeftCorner.x - 20, y: code.location.topLeftCorner.y - 20, width: code.location.topRightCorner.x - code.location.topLeftCorner.x + 10, height: code.location.bottomLeftCorner.y - code.location.topLeftCorner.y + 10, }; image.crop(cropMeta.x, cropMeta.y, cropMeta.width, cropMeta.height); image.writeAsync("./output4.jpg"); }); } else { console.log("decode error"); } }) .catch(function (err2) { if (err2) { console.log(err2); cb(null, null); } });
but I find there is not crop all the qrcode part, image like below:
also if I change 10 to 50, it seem ok, But I have no idea that is a support method? or have any other method to find out x, y, width, height?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, from the decode result, I want to crop the qroce from the image, next is my code:
but I find there is not crop all the qrcode part, image like below:
also if I change 10 to 50, it seem ok, But I have no idea that is a support method? or have any other method to find out x, y, width, height?
The text was updated successfully, but these errors were encountered: