Skip to content
New issue

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

Any Idea why this Qr Can Not be Parsed? #201

Open
ewkonzo opened this issue Apr 16, 2021 · 1 comment
Open

Any Idea why this Qr Can Not be Parsed? #201

ewkonzo opened this issue Apr 16, 2021 · 1 comment

Comments

@ewkonzo
Copy link

ewkonzo commented Apr 16, 2021

5c8a3959-89b0-48cb-9a91-2b32843417af

@azack
Copy link

azack commented May 3, 2021

Works for me with jsqr@^1.4.0 and upng-js@^2.1.0 as a helper (since this is a test):

 const pngBuffer = fs.readFileSync(
      "tests/unit/src/views/data/115042899-92ee0c00-9edc-11eb-9a4b-b0298453765d.png"
    );
    const pngData: upng.Image = upng.decode(pngBuffer);
    const qrArray = new Uint8ClampedArray(upng.toRGBA8(pngData)[0]);
    const mockImageData: ImageData = {
      data: qrArray,
      height: 1125,
      width: 576
    };
    ...
     const code = jsQR(
        mockImageData.data,
        mockImageData.width,
        mockImageData.height
      );
    if (code) {
      console.log("Found QR code", code);
    }
  Found QR code {
     binaryData: [
       104, 116, 116, 112, 115, 58,
        47,  47,  97,  98,  99, 46,
       107, 111, 110, 122, 111, 46,
       120, 121, 122,  47
     ],
     data: 'https://abc.konzo.xyz/',
     chunks: [ { type: 'byte', bytes: [Array], text: 'https://abc.konzo.xyz/' } ],
     version: 3,
     location: {
       topRightCorner: { x: 346, y: 865 },
       topLeftCorner: { x: 230, y: 865 },
       bottomRightCorner: { x: 346, y: 981 },
       bottomLeftCorner: { x: 230, y: 981 },
       topRightFinderPattern: { x: 332, y: 879 },
       topLeftFinderPattern: { x: 244, y: 879 },
       bottomLeftFinderPattern: { x: 244, y: 967 },
       bottomRightAlignmentPattern: { x: 320, y: 955 }
     }
   }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants