EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 446 forks source link

How to save and send a photo after recognition? #1623

Open aschurf opened 4 years ago

aschurf commented 4 years ago

Hello!

Thanks for the great tool, but I don’t understand how to save the photo after recognizing the face, as well as send it to the backend of my site. I am doing a small project, the user must smile at the camera, after which the photo should be saved in the backend

I will be glad of any help

aschurf commented 4 years ago

Found a solution:

const bmp = event.object.lastVisionImage.getBitmap();
                                        const source = new ImageSource();
                                        source.setNativeSource(bmp);

var imageData = source.toBase64String("jpeg");

But on iOS (real device), an error occurs:

'NativeScript encountered a fatal error: TypeError: event.object.lastVisionImage.getBitmap is not a function. (In 'event.object.lastVisionImage.getBitmap()', 'event.object.lastVisionImage.getBitmap' is undefined)

kriefsacha commented 3 years ago

Found a solution @aschurf ?