Redth / ZXing.Net.Mobile

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

iOS: BarcodeFormat.ITF maps to wrong type AVMetadataObjectType.ITF14Code #1036

Open MFinkBK opened 2 years ago

MFinkBK commented 2 years ago

When using the useAVCaptureEngine flag and specifying a list of all the formats I want to scan, and I'm specifying BarcodeFormat.ITF in the list, the library picks the wrong AVMetadataObjectType.ITF14Code, which according to Wikipedia (https://en.wikipedia.org/wiki/ITF-14) is a 14-digit-only version of the Interleaved2Of5Code code, which can have any (even) length. So I think the mapping in AVCaptureBarcodeFormatFromZXingBarcodeFormat is wrong and should pick AVMetadataObjectType.Interleaved2of5Code instead:

https://github.com/Redth/ZXing.Net.Mobile/blob/f8abca8d7e4d0e1e76b6ba6b9418545aa2085036/ZXing.Net.Mobile/iOS/AVCaptureScannerView.ios.cs#L600-L601

What do you think?

I can provide a PR if it's necessary to speed things up for a new (beta) release. Thanks! Kind Regards, Michael

MFinkBK commented 2 years ago

@Redth any chance to merge the change into any kind of NuGet package anytime soon? Thank you!