Closed wladston closed 5 years ago
Thanks for the report! This is probably a bug in our decoding, we'll fix it and add a test case.
Hmm @wladston I actually can't reproduce this issue.
The following code seems to work just fine
import jsQR from "../src";
import * as helpers from "./helpers";
(async () => {
const imageData = await helpers.loadPng(`issue-97.png`);
const code = jsQR(imageData.data, imageData.width, imageData.height);
if (code) {
console.log("FOUND", code);
}
})().then(() => process.exit(0)).catch((e) => { throw e; });
Logging
FOUND
{ binaryData: [ ... ],
data: 'bbbbb515293bbbbbbbbbbbbbbb13904599bbbbbbbbbbbbbbbbbbbbbb1bbbbbbb',
chunks:
[ { type: 'byte', bytes: [Array], text: 'bbbbb' },
{ type: 'numeric', text: '515293' },
{ type: 'byte', bytes: [Array], text: 'bbbbbbbbbbbbbbb' },
{ type: 'numeric', text: '13904599' },
{ type: 'byte',
bytes: [Array],
text: 'bbbbbbbbbbbbbbbbbbbbbb1bbbbbbb' } ],
location:
{ topRightCorner: { x: 147.99999999999997, y: 16.000000000000004 },
topLeftCorner: { x: 16.000000000000004, y: 16.000000000000004 },
bottomRightCorner: { x: 147.99999999999994, y: 147.99999999999994 },
bottomLeftCorner: { x: 16.000000000000004, y: 147.99999999999997 },
topRightFinderPattern: { x: 134, y: 30 },
topLeftFinderPattern: { x: 30, y: 30 },
bottomLeftFinderPattern: { x: 30, y: 134 },
bottomRightAlignmentPattern: { x: 122, y: 122 } } }
I'm going to close this issue since it seems we're able to scan just fine. That said I'd love understand what was causing you to not be able to decode, and if you believe there's still an issue please re-open.
I cannot recognize the above QR code. I use https://cozmo.github.io/jsQR/ and the code is not recognized.
@cozmo at a first glance, I couldn't discover why, but passing the image as a file works, whereas trying to scan it with the camera (as described by @gidbrn) doesn't. Maybe you have better ideas on how to make this report more reproducible?
@cozmo, did you try scanning it with the camera?
Other QR code decoders seem to handle it just fine.