capacitor-community / barcode-scanner

A fast and efficient (QR) barcode scanner for Capacitor
MIT License
438 stars 173 forks source link

Web impl EAN-13 and other formats not working except QR #267

Open muuvmuuv opened 1 year ago

muuvmuuv commented 1 year ago

Describe the bug

We've used the Web PWA version a long time now, QR and other formats work well, but EAN-13 does never return any result. The demo from ZXing 1D instead works pretty well and fast, any idea?

https://zxing-js.github.io/library/examples/multi-camera/

To Reproduce Steps to reproduce the behavior:

  1. Try any 1D EAN-13

Expected behavior

Should work like the ZXing web demo.

Screenshots If applicable, add screenshots to help explain your problem.

Version [e.g. v1.0.0] ^3

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

muuvmuuv commented 1 year ago

Found out web impl just needs two adjustments:

https://github.com/capacitor-community/barcode-scanner/blob/main/src/web.ts#L50

Must push format!

https://github.com/capacitor-community/barcode-scanner/blob/main/src/web.ts#L168

Use BrowserMultiFormatReader...

Now all formats are supported by ZXing! 🚀