vue-qrcode-reader icon indicating copy to clipboard operation
vue-qrcode-reader copied to clipboard

Shape Detection API - inverted qr

Open mrkazu opened this issue 4 years ago • 3 comments

Hello, the use of Shape Detection API removed the ability to scan inverted QR. This worked realy well with previous version 2.3.18. Is there a way to get inverted qr to work with Shape Detection API? All our qr-codes are laser engraved on black metal.

mrkazu avatar Apr 16 '21 08:04 mrkazu

Please give us an option to be able to scan inverted QR like an optionnal props ? my whole app for a client depend on this feature

nabenzine avatar Oct 14 '21 20:10 nabenzine

I expected to make faster progress on the Shape Detection API polyfill. Besides bringing back support for inverted QR codes it’s supposed to introduce support for all kinds of other Barcode types. Unfortunately I’m a too busy at the moment.

If you need an awkward but relatively quick workaround would be to adjust this string:

https://github.com/gruhn/barcode-detector-polyfill/blob/41d64b7d75b10d099158c528e257e4e0a48fb171/src/worker/worker.ts#L13

to attemptBoth, onlyInvert or invertFirst; Deploy a fork of barcode-detector-polyfill. Then also fork vue-qrcode-reader and install your adjusted version of barcode-detector-polyfill

gruhn avatar Oct 14 '21 21:10 gruhn

thank you gruhn. this worked perfectly.

mrkazu avatar Dec 17 '21 18:12 mrkazu

@gruhn what prevents fixing this? What support is needed? 🙂

glumb avatar May 15 '23 12:05 glumb

Me being busy. If you would like to help, I‘d gladly merge your PR. Only requirement: I can test it without having to do any local setup. Ideally just modify the demo page and deploy it through your fork. A GitHub action is already configured.

gruhn avatar May 15 '23 16:05 gruhn

Would an acceptable fix be to basically implement your workaround by changing the default in the barcode-detector-polyfill to 'attemptBoth'. Then releasing a new version of it and then updating the dependency on this library? I mean do you see any drawbacks int not making it configurable but changing the default?

glumb avatar May 15 '23 19:05 glumb

Apparently it’s 50% slower or something but yes it would be acceptable from my side.

gruhn avatar May 16 '23 12:05 gruhn

I checked the demo page. Seems to work now. I'm closing this.

gruhn avatar Jun 19 '23 11:06 gruhn