Open ProstoCesar opened 1 month ago
Same trouble for me with QRcode.
The problem is in MLkit https://github.com/juliansteenbakker/mobile_scanner/pull/1071
As reported above, this seems like an issue in MLKit that does not detect inverted barcodes.
I'll test this on MacOS, to see if the Vision API has the same issue. If MacOS does not have that issue, then this will be fixed in the next major release, that will use the Vision API on iOS as well. For Android we will look into adding support for inverted barcodes, like with the PR mentioned above.
According to the docs, the Vision API reports whether a barcode was inverted, so it should support this.
https://developer.apple.com/documentation/vision/vnbarcodeobservation/iscolorinverted
This flag is only available on iOS 17 and higher, so I'm not sure if detecting inverted barcodes will work on iOS 16 and below.
@ProstoCesar We had the same issue and forked library to invert image before proceeding to ML Kit, feel free to check https://github.com/injil-kz/mobile_scanner_clone
Hello, guys. I've encountered an issue where inverted (dark theme) EAN-13 barcodes are not recognized by mobile_scanner. When using a standard barcode (black bars on white background), the barcode is scanned correctly. However, when I invert the colors (white bars on black background), the scanner fails to detect the barcode. Steps:
Screenshots: Correctly recognized barcode in light theme: Barcode not recognized in dark theme:
Environment: mobile_scanner version: 5.2.3 Flutter version: 3.24.3 Dart version: 3.5.3 Devices: Honor 30, Pixel 8, Honor 10x Lite