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

pdf417 not scanning #7

Open
joleeee opened this issue Feb 10, 2025 · 7 comments
Open

pdf417 not scanning #7

joleeee opened this issue Feb 10, 2025 · 7 comments

Comments

@joleeee
Copy link

joleeee commented Feb 10, 2025

Describe the bug

This might be an upstream issue. See also gruhn/vue-qrcode-reader#459

Basically, barqode will detect and scan PDF417 codes, but the output is emptystring "".

I tested again today with a real boarding pass and got nothing, while using a random website scanner actually decodes the data properly.

from https://barqode.sveco.dev/docs/demos/full-demo:

Image

from random website (working)

Image

Reproduction

  1. https://barqode.sveco.dev/docs/demos/full-demo
  2. try to scan a PDF417 code, ex. Image

Logs

System Info

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M2
    Memory: 354.34 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.16.0 - ~/.volta/tools/image/node/20.16.0/bin/node
    Yarn: 4.0.0-rc.51 - ~/.volta/tools/image/yarn/4.0.0-rc.51/bin/yarn
    npm: 10.8.1 - ~/.volta/tools/image/node/20.16.0/bin/npm
    pnpm: 8.8.0 - ~/Library/pnpm/pnpm
    bun: 1.0.5 - ~/.volta/bin/bun
  Browsers:
    Chrome: 133.0.6943.53
    Safari: 17.5

Severity

blocking all usage of Barqode

@ollema
Copy link
Collaborator

ollema commented Feb 10, 2025

interesting! will investigate

@joleeee
Copy link
Author

joleeee commented Feb 10, 2025

it works on iOS
Image

i tried safari on mac, and that would not even produce ""

@ollema
Copy link
Collaborator

ollema commented Feb 10, 2025

could you try https://zxing-wasm-demo.deno.dev/

zxing-wasm is the polyfill that is used when there is no native support. we have not updated that in a while so maybe it works upstream.

I’m thinking that whether or not this polyfill is active could explain when we run into these issues.

also could you include the console logs from barqode? it should indicate if the polyfill is used IIRC.

@joleeee
Copy link
Author

joleeee commented Feb 10, 2025

Yes, https://zxing-wasm-demo.deno.dev/ works perfectly.

I think this line from the console is relevant:

[barqode] will use native BarcodeDetector.

Whole log:

Removing unpermitted intrinsics
barqode-stream.C4fzdaJK.js:1 [barqode] starting camera with constraints:  {"facingMode":"environment"}
barqode-stream.C4fzdaJK.js:1 [barqode] calling getUserMedia
scanner.CcqxawNJ.js:2 [barqode] will use native BarcodeDetector.
barqode-stream.C4fzdaJK.js:1 [barqode] waiting for video element to load
barqode-stream.C4fzdaJK.js:1 [barqode] video element loaded
barqode-stream.C4fzdaJK.js:1 [barqode] camera ready
scanner.CcqxawNJ.js:2 [barqode] start scanning
scanner.CcqxawNJ.js:2 [barqode] will use native BarcodeDetector.

@ollema
Copy link
Collaborator

ollema commented Feb 10, 2025

wait, so it doesn’t work with the native API?

that is very unfortunate. I’m not sure how to best proceed then, will have to think about this…

@joleeee
Copy link
Author

joleeee commented Feb 10, 2025

Does it work for you? If it's a chrome bug then they might be able to fix it. I don't know how the API works, for all i know returning "" might be the equivalent of "not implemented" which is not really a "bug" bug on their side.

Alternatively, could allow us to toggle using the polyfill even if it's not required

@ollema
Copy link
Collaborator

ollema commented Feb 10, 2025

what I mean was if it's not working with the native API then it's much harder to fix since we cannot really change how the built in native browser APIs work.

we might have to expose a setting for always using the polyfill as you suggested, will look into that. or happy to review a PR if you interested to contribute

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