capawesome-team / capacitor-mlkit

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

feat: Scan Multiple QR Codes at once #137

Closed talhabinkhalil closed 8 months ago

talhabinkhalil commented 8 months ago

Plugin(s)

Current problem

I am facing a scenerio in which there are 5 different QR codes at a place. I want a feature which enables the user to scan all of them at once and then select value of his own choice.

Preferred solution

Barcode Scanner should detect multiple qr codes from camera and then allow the user to select only single value from these scanned values.

Alternative options

No response

Additional context

No response

Before submitting

robingenz commented 8 months ago

This is a feature that you should build into your app. The plugin already offers you all the functionalities for this. For this reason, i'm closing this issue as not planned.

talhabinkhalil commented 8 months ago

@robingenz
thumbnail_Outlook-mvuncuzp Here is the image attached, scanner only scans one QR code at once. Does it provide the functionality to scan all of them ? I am using scanner camera to scan the code.

robingenz commented 8 months ago

For example, the readBarcodesFromImage(...) methods returns an array of barcodes, see https://capawesome.io/plugins/mlkit/barcode-scanning/#readbarcodesfromimageresult.

talhabinkhalil commented 8 months ago

@robingenz i have explored this function , But I want that feature on scanning instead of QR CODES Image. Does this package provide scanning multiple QR codes on scanning instead of reading codes from image ?

robingenz commented 8 months ago

Oh, you should have mentioned that in your issue. Currently the barcodeScanned listener fires once per qrcode, see: https://github.com/capawesome-team/capacitor-mlkit/blob/bfcfaff900218f19b2b6bdfa27e940b02d451b24/packages/barcode-scanning/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/barcodescanning/BarcodeScanner.java#L350 You could let the user scan until no new barcodes are recognized. Alternatively, I could adapt the listener so that it returns all barcodes at once. But even then, there is no guarantee that the ML Kit Barcode Scanning SDK will recognize all barcodes on the first scan.