takePicture = async function() {
if (this.camera) {
const options = { quality: 0.5, base64: true, pauseAfterCapture: true };
const data = await this.camera.takePictureAsync(options);
this.setState({path: data.uri});
}
}
takePicture
is my function to click the image. When I don't use pauseAfterCapture
in options, then it takes 3 seconds for the image to get captured, while camera is still active in those 3 seconds. And when I use pauseAfterCapture
it takes me around 1.5 seconds to capture image with the camera being active during those 1.5 seconds.
I've also used skipProcessing
which helps me with fast capture but I don't want to lose other information like base64, width, quality, mirrorImage, exif, etc like mentioned on react-native-camera
github page.
Is this has something to do with takePictureAsync
taking time to resolve? If yes, then how do I manage it?
Also, if this question has no solution, how can I use ActivityIndicator when the image is getting captured.
P.S. - I know this question has been asked a lot but I'm unable to find any solution for this. I hope we all can come up with a solution so that it can help other people in future.