mlkit icon indicating copy to clipboard operation
mlkit copied to clipboard

[Bug report] setBarcodeFormats being ignored

Open panagiac opened this issue 1 year ago • 1 comments

Describe the bug It seems that the method setBarcodeFormats() is not working as intended, detecting unspecified formats.

To Reproduce Put this settings on BarcodeScannerOptions:

  1. 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()
  1. Scan this Barcode example: image

  2. The output's format is 512 (which is FORMAT_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

panagiac avatar Mar 24 '23 09:03 panagiac

Hello, is there any update on this? Am I doing something wrong maybe?

panagiac avatar Jun 07 '23 13:06 panagiac