mlkit
mlkit copied to clipboard
[Bug report] setBarcodeFormats being ignored
Describe the bug
It seems that the method setBarcodeFormats()
is not working as intended, detecting unspecified formats.
To Reproduce
Put this settings on BarcodeScannerOptions
:
- Setup the scanner as this:
val barcodeScannerOptions = BarcodeScannerOptions.Builder()
.setExecutor(executor)
.setBarcodeFormats(
Barcode.FORMAT_EAN_8,
Barcode.FORMAT_EAN_13,
Barcode.FORMAT_UPC_E
).build()
-
Scan this Barcode example:
-
The output's
format
is512
(which isFORMAT_UPC_A
) and the result is:123456789012
Expected behavior
I expect to receive format 32
(which is FORMAT_EAN_13
) and result being 0123456789012
. (with the starting 0
)
I tried to test this same barcode with Scandit and Apple's AVFoundation Framework and both outputs the FORMAT_EAN_13
result with the starting 0
.
SDK Info:
- SDK Name & Version: com.google.mlkit:barcode-scanning:17.1.0
Smartphone:
- Emulator API 33
- OnePlus 7 API 30
Hello, is there any update on this? Am I doing something wrong maybe?