afriscic / BarcodeScanning.Native.Maui

Barcode scanning library for .NET MAUI
https://www.nuget.org/packages/BarcodeScanning.Native.Maui
MIT License
162 stars 31 forks source link

Code39: incomplete codes are being scanned #42

Closed Olaf-R closed 5 months ago

Olaf-R commented 5 months ago

It seems that OnDetectionFinished is being fired prematurely (at least) for Code39 barcodes. I would have expected that start and stop markers would be considered and OnDetectionFinished would only fire if both have been detected, but this doesn't seem to be the case.

As an easy repro, just cover part of a Code39 code and scan it.

afriscic commented 5 months ago

Hello. Unfortunately, this is entirely dependent on underlying frameworks on both Android and Apples systems, so there isn't anything I can modify. Best advice I could give you is that you set PoolingInterval to at least 300 ms so it detects the whole barcode in some frame and then implement your custom logic in OnDetectionFinished event handler to reject false readings.

Olaf-R commented 5 months ago

Thanks! I already have my own verification in place, so it's not a problem on my end. Just thought you'd like to know. :-)

FWIW, I'm sure I had seen the markers ("*" in this case, this seems to be true for Code39 at least) at some point (I even replaced them with an empty string, JIC), but during the last extended test-period all codes came without the asterisk in both RawValue and DisplayValue.