Redth / ZXing.Net.Maui

Barcode Scanning for MAUI?
MIT License
456 stars 150 forks source link

QR code Scanning doesn't work on some android phones #200

Open trampster opened 1 day ago

trampster commented 1 day ago

QR code scanning doesn't work on the following android phones:

The camera view shows but it never detects the QR code.

The preloaded camera app on these phones can scan these code successfully. And the same QR code can be scanned by ZXing.Net.Maui on other android and iOS phone models.

image

I have attached logs from trying to scan with the Oppo A54. There are logs from when the scan page is loaded but there is nothing apart from GC collection stats while its actually trying to scan.

OPPO A54 QR code scan logs.txt

We are using:

trampster commented 22 hours ago

After doing some debugging in ZXing.Net.Maui we have discovered that on the phones that don't work a camera frame is being retrieved and sent to ZXing.Net which is returning null on the line:

var b = zxingReader.Decode(ls)?.ToBarcodeResult();

I suspect that there is something wrong with the luminance data.

I have managed to dump the raw data from PixelBufferHolder.Data from working and not working phones.

Interestingly the data on the phone that isn't working is significantly larger, 491 kB instead of 307 kB . Given that both should be 640x480 then they should be exactly the same size.

I've attached the raw YUV data from both the working and the not working phones.

WorkingYUVData.zip NotWorkingYUVData.zip