Skip to content

[firebase_ml_vision] Unable to detect barcode in png file in Android #2597

@viplavrawal

Description

@viplavrawal

Describe the bug
Running the code barcodeDetector.detectInImage(visionImage) on a png file results in error Bitmap format must be ARGB_8888.

To Reproduce
Steps to reproduce the behavior:

  1. Select a png file from app's documentsDirectory.
  2. Try to scan barcode from that file.
  3. See the error Bitmap format must be ARGB_8888.

Expected behavior
The file should be scanned like jpeg files.

Flutter doctor

[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.14.6 18G4032, locale en-IN)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[!] Xcode - develop for iOS and macOS (Xcode 11.2.1)
    ! CocoaPods 1.7.4 out of date (1.8.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade:
        sudo gem install cocoapods
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.45.1)
[✓] Connected device (1 available)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions