capawesome-team / capacitor-mlkit

⚡️ ML Kit plugins for Capacitor. Supports Android and iOS.
https://capawesome.io/plugins/mlkit/
Apache License 2.0
139 stars 38 forks source link

bug: PDF417 from a Driver's License does not scan. #169

Open seanrallSRS opened 1 month ago

seanrallSRS commented 1 month ago

Plugin(s)

Version

6.1.0

Platform(s)

Current behavior

When Scanning using the Demo app capacitor-mlkit-plugin-demo and selecting PDF417 and try and scan a US Driver's License or another complex PDF417 barcode the scanner does not return anything and can't scan the barcode.

Expected behavior

Expect the Drivers License PDF417 barcodes can be scanned.

Reproduction

https://github.com/robingenz/capacitor-mlkit-plugin-demo

Steps to reproduce

  1. Build the demo app
  2. Select PDF417
  3. Select Start Scan / also tested the just Scan function both dont scan the PDF417
  4. Sanner opens and does not scan

Other information

No response

Capacitor doctor

Capacitor Doctor

Latest Dependencies:

@capacitor/cli: 6.1.1 @capacitor/core: 6.1.1 @capacitor/android: 6.1.1 @capacitor/ios: 6.1.1

Installed Dependencies:

@capacitor/cli: 6.0.0 @capacitor/core: 6.0.0 @capacitor/ios: 6.0.0 @capacitor/android: 6.0.0

[success] Android looking great! 👌 [error] Xcode is not installed

Before submitting

robingenz commented 1 month ago

Please provide a sample barcode and the expected value.

github-actions[bot] commented 1 month ago

This issue has been labeled as needs: reproduction. This label is added to issues that need a code reproduction.

Please provide a Minimal, Reproducible Example using this template in a public GitHub repository so we can debug the issue.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for us to reproduce the issue.

seanrallSRS commented 1 month ago

Please provide a sample barcode and the expected value.

Here is an example of a back of a Pennsylvania Drivers license PDF417 barcode that the sample app cant scan with StartScan https://websdk-vin.demos.scandit.com/vin_pdf.pdf

robingenz commented 1 month ago

Reading PDF417 codes is not a problem per se (for example, it works with this code). But I was able to reproduce the problem with your code. I think there are two reasons for this:

  1. the demo app uses a square detection area, but the code is obviously not square. You need to adjust this in your code.
  2. because the code is so wide, the device has to be held further away and in my case the image was no longer focused. Here I have to check whether I can implement an autofocus. But I can only do that when I'm back in the office (I'm currently on vacation).