barcode-scanner
barcode-scanner copied to clipboard
Scan QR from Photo Gallery
Is your feature request related to a problem? Please describe. I would like this plugin to have an option to scan QR on an image by uploading from Photo Gallery
Describe the solution you'd like
There should be a function to call that will open the photo gallery and after selecting a photo, the function will return the QR Data that is on the photo.
ex:
getAndScanQR().then(qrData => console.log(qrData))
Describe alternatives you've considered
An alternative could be: developers can handle getting the photo from the gallery using the @capacitor/camera
plugin then a function for scanning the QR code that accepts a base64 or dataURI as a parameter to the function and the return would be the QR Data
scanQR(base64String: String).then(qrData => console.log(qrData))
I need to have a look at this once I am back from my vacation, but at least on iOS it might not be that easy since the "scanner" is directly linked to the camera feed at the moment, but I might be wrong...
@rs2-davebanguilan It should be possible to implement this with the new implementation in the ml-kit
branch. Unfortunately, I don't really have time to add additional features, since I am still working on basic things in this new version.
I already started the preparation of the permission stuff, which means I prepared the interfaces so far, that it would be possible to add the permission calls without any breaking changes in the future, but I am not entirely sure when someone will have time to have a look at it. We are open to PRs though ;)