react-zxing icon indicating copy to clipboard operation
react-zxing copied to clipboard

Mirrored QR Codes

Open charlesfayal opened this issue 2 years ago • 7 comments

Is there a way to read mirrored QR Codes?

charlesfayal avatar Aug 14 '23 20:08 charlesfayal

It appears that flipping a QR code renders it invalid. The scanner should be capable of detecting and transforming the flipped code before decoding it. However, I'm uncertain if zxing has this capability. Have you come across any information regarding this?

adamalfredsson avatar Aug 17 '23 14:08 adamalfredsson

I don’t know if it helps but react-qr-scanner has this capability and used zxing. But that library is getting outdatedOn Aug 17, 2023, at 7:03 AM, Adam Alfredsson @.***> wrote:

Message sent from a system outside of UConn.

It appears that flipping a QR code renders it invalid. The scanner should be capable of detecting and transforming the flipped code before decoding it. However, I'm uncertain if zxing has this capability. Have you come across any information regarding this? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

charlesfayal avatar Aug 17 '23 15:08 charlesfayal

Hi, @adamalfredsson, hope you're well.

I'm the owner of zxing-wasm which is an ES module WebAssembly build wrapper of an actively maintained cpp port of ZXing zxing-cpp. zxing-wasm has smaller sizes, can read more barcode formats, has better performance and more decode hints to configure. It can also read mirrored or color-inverted barcodes.

As I know @zxing/library is in maintenance mode now and there won't be any active feature updates in the foreseeable future. I was wondering if we can join forces and integrate the zxing-wasm package into this repo?

I'm also expecting more feedbacks on the API or other things so I can make proper adjustments before releasing the first official version.

BTW, I have an another repo barcode-detector which serves as a polyfill of the Barcode Detection API of web browsers, that is built upon zxing-wasm. And barcode-detector is utilized in vue-qrcode-reader which is something like this repo but for Vue.js users. I have made some contributions there, and I think there're some common issues we can learn and solve together, especially those related to camera behaviors on different devices.

Sec-ant avatar Nov 09 '23 15:11 Sec-ant

Hi Guys, glad that you are already discussing this. Mirroring the image is super important from the user perspective. In the current setup, the user has to move the image in the opposite direction and it is counter-intuitive and spatially difficult for most people. Sure, with practice anyone can learn. @Sec-ant @adamalfredsson

In-addition, any component should have a visible and audible way to confirm capture of the barcode.

Thanks for the great work.

SD-Dude avatar Nov 16 '23 18:11 SD-Dude

Hi @Sec-ant!

I think this sounds great and I would love to integrate this into react-zxing. Are you willing to help with this?

Thanks!

adamalfredsson avatar Nov 19 '23 21:11 adamalfredsson

@adamalfredsson Sure!

Given the different hints and the additional control of instantiation process of wasm, do you think we should add a new hook or reuse the current one with some new options maybe?

Sec-ant avatar Nov 20 '23 01:11 Sec-ant

@Sec-ant I think it would be great to preserve the current interface to the largest extent possible – perhaps we can add a decoder option of type "zxing" | "zxing-wasm"?

And thanks a lot for helping out with this!

adamalfredsson avatar Nov 21 '23 10:11 adamalfredsson