quickie icon indicating copy to clipboard operation
quickie copied to clipboard

Scan from file

Open Doomsdayrs opened this issue 3 years ago • 2 comments

Sometimes the QR code is not in person, but on the device itself.

It would be nice to have a config option to scann a file

Doomsdayrs avatar Mar 08 '22 06:03 Doomsdayrs

Hi @Doomsdayrs, thanks for reaching out. Currently the focus of the library is the camera integration. But I will see if I can add some way to scan files in the future.

G00fY2 avatar Mar 22 '22 09:03 G00fY2

So, in QRCodeAnalyzer.kt there is a call to pass the captured image to the analysis engine: barcodeScanner.process(imageProxy.toInputImage())

One might need to pass an image to a similar MLKit call in your own workflow (wherever the on-device image is sourced...)

I get a healthy part of the value of quickie is the proper MLKit configuration, so one could also explore reusing or exposing the ImageAnalysis of the library for a way to make this call yourself in your own code?

Alternatively, if you forked, one could create or extend a way to attach an image to an analyzer so it could be passed into the quickie image analysis object in QRScannerActivity.kt

apelican avatar Aug 22 '22 18:08 apelican

hi, is there any updates?

fzyzcjy avatar Nov 02 '22 02:11 fzyzcjy

hi, is there any updates?

2dust avatar Apr 16 '23 12:04 2dust

Hi and sorry for not giving any updates about this feature request.🙏 I actually started implementing such a feature on a local branch, but it did not went well and felt kind of wrong for this library. The focus of quickie is about an easy integration with the camera and therefore UI focused. Calling native filepicker and sending the file uri to the scanner would require this library to decouple the barcode scanner from CameraX (which is currently not the case).

The part of the code which handles the ML Kit barcode scanner is honestly pretty small. So I would actually advice you to just follow the documentation about scanning files: Using a file URI

I am sorry but because of these reasons I will reject this feature request.😞

G00fY2 avatar Apr 16 '23 16:04 G00fY2