Redth / ZXing.Net.Mobile

Barcode Scanner for Xamarin.iOS, Xamarin.Android, UWP and Tizen
MIT License
1.07k stars 701 forks source link

Barcode detection issues with iPhone 12 Pro Max #1000

Open Jamie-Wallace opened 3 years ago

Jamie-Wallace commented 3 years ago

Hi There

We are experiencing issues scanning barcodes oniPhone 12 Pro Max devices where the default camera has a longer focal point.

You have to move the device quite far away from the barcode to have it focus, by which point it is difficult to acquire the actual barcode as it is so small, particularly if any defects are present.

As well as our app this is reproducible in the ZXing Net Mobile sample app.

1) Install ZXing Sample app on iPhone 12 Pro. 2) Attempt to scan relatively small barcode. 3) Notice the zoom factor is similar to device Camera app default x1. 4) You have to move quite far away and then hold still at the perfect distance. 5) This will not work with any kind of defect on the barcode it must be a sharp image. 6) Repeat above with iPhone 7 and the barcode scans extremely quick and reliably.

It is worth mentioning that the iOS version of ZXing copes well and seems to be selecting 0.5x zoom.

We have tried all ZXing Mobile Net settings that we can see, both in code and via sample app.

Do you have any advice or information on how we might improve this so we can continue using the library?

Many Thanks

tigreye007 commented 3 years ago

Same issue. Running Xamarin.Forms 5.0.0.2012, ZXing.Net.Mobile.Forms 3.1.0-beta2 on an iPhone 11, latest iOS version. Works like a charm in Android, but not on my physical iOS device. The camera view appears, but the OnScanResult event handler never fires.

reallybadatusernames commented 3 years ago

Same issue. Smaller barcode formats like pdf417 don't work but larger do.

volkan-akkus-tr commented 1 year ago

Maybe, don't use a ScannerPage. Use their MobileBarcodeScanner. As Igor Kravchenko stated at https://stackoverflow.com/a/66296505/20395535

ZXing.Mobile.MobileBarcodeScanner scanner = new();
ZXing.Result result = await scanner.Scan().ConfigureAwait(false);

if (result != null && !string.IsNullOrWhiteSpace(result.Text))
{
    // result.Text is ready.
}

Kudos to Igor.