gruhn / vue-qrcode-reader

A set of Vue.js components for detecting and decoding QR codes.
https://gruhn.github.io/vue-qrcode-reader
MIT License
2.03k stars 330 forks source link

Support barcode formats other than QR codes #356

Closed gruhn closed 10 months ago

gruhn commented 10 months ago

The barcode detector polyfill used in vue-qrcode-reader supports a bunch of other barcode formats not just QR codes. It's probably not too hard to make use of that in vue-qrcode-reader. Previously, people have ask for that: #199 #49.

We could add a new prop formats on all three components: QrcodeStream, QrcodeDropZone, QrcodeCapture, which accepts an array of strings and/or a single string and passes the value through to the BarcodeDetector constructors: here, here and here.

Some things to consider:

  1. What if the component prop is changed during scanning? The user probably expects the different formats to be recognized immediately. It's probably necessary to interrupt and restart scanning to construct a new BarcodeDetector instance.
  2. Different barcode formats look quite different. Will tracking still work as is?

Anyone willing to contribute, I'd be happy to merge your PR :slightly_smiling_face: Also check out CONTRIBUTING.md

FourAndHalf commented 10 months ago

could you assign me this issue, I am willing to work on it

gruhn commented 10 months ago

@FourAndHalf really cool that you want to contribute. Looks like @samydoesit has already started working on this though.

FourAndHalf commented 10 months ago

oh, no worries

gruhn commented 10 months ago

(Posting new demo videos here, so GitHub will generate me a link)

https://github.com/gruhn/vue-qrcode-reader/assets/26570572/bec5bebe-97b8-446c-b4c5-8681b1567e5c

https://github.com/gruhn/vue-qrcode-reader/assets/26570572/d382d2a9-3fa1-4b28-8821-392c5025045c

gruhn commented 10 months ago

closing this. Thanks @samydoesit !