journeyapps / zxing-android-embedded

Barcode scanner library for Android, based on the ZXing decoder
https://journeyapps.com/
Apache License 2.0
5.76k stars 1.27k forks source link

Wrong type scanned #592

Open Sophon opened 3 years ago

Sophon commented 3 years ago

Description of the problem:

When I scan an EAN13 code: https://imgur.com/a/fqHASwQ it detects as UPC_A - so the leading zero gets ignored.

Which library version are you using? 4.1.0

Which phone/tablet are you using, and which Android version does it run? (e.g. Samsung Galaxy S5, Android 5.0)

Newest emulator, newest LineageOS, also tested on Samsung Galaxy S7.

Does the same happen on other devices or an emulator? Yes.

Can you reproduce the issue in the sample project included with the library? Yes.

rkistner commented 3 years ago

In general: 1D barcode detection is known to be inaccurate. The best workaround for this is to limit the barcode types to the ones you're interested in.

In this specific case: Apart from the label, there is no difference between a UPC-A barcode, and an EAN-13 barcode with a leading zero. Once again, the only workaround is to disable UPC-A from the list of barcodes to try scan.