react-native-rectangle-scanner icon indicating copy to clipboard operation
react-native-rectangle-scanner copied to clipboard

Is there any way to capture the image with front camera?

Open lightning331 opened this issue 5 years ago • 8 comments

lightning331 avatar Feb 12 '20 02:02 lightning331

@lightning331 This is something that can be added pretty easily at some point. I have to ask though, what is your use case for something like this?

humphreyja avatar Feb 12 '20 04:02 humphreyja

I am developing an app scanning ID Card at the moment. It has to take the feature of the front camera. Can you do it?

lightning331 avatar Feb 12 '20 05:02 lightning331

Ahh ok that makes sense. I've always wondered why this would exist which is why I didn't include it as a feature. Ok yeah I can add this. I'm thinking it might be beneficial for some more configuration on selecting the camera here (so you can choose the super wide angle lens on iPhone 11 instead of the generic camera). I'll see if I can get something working for you in the next week.

humphreyja avatar Feb 12 '20 17:02 humphreyja

@lightning331 Could you try out PR #21? It adds support for different camera types. For your case, you should just be able to set cameraId={2} to get the front facing camera.

Just a note, Android is a bit finicky. Maybe it's an issue with the older camera api but I couldn't figure out how to change the camera after it has already been loaded. Basically what this means is that if you wanted to change the camera from front to back after it has already started, you need to unmount and remount it.

humphreyja avatar Feb 17 '20 22:02 humphreyja

Ok, I will check. Thanks @humphreyja

lightning331 avatar Feb 18 '20 01:02 lightning331

Ahh ok that makes sense. I've always wondered why this would exist which is why I didn't include it as a feature. Ok yeah I can add this. I'm thinking it might be beneficial for some more configuration on selecting the camera here (so you can choose the super wide angle lens on iPhone 11 instead of the generic camera). I'll see if I can get something working for you in the next week.

Chamo, cuándo lo tendrás listo? Muchas gracias

Gricardov avatar Mar 29 '20 20:03 Gricardov

@Gricardov Have you tried PR #21? I will probably merge this in this week.

humphreyja avatar Mar 30 '20 16:03 humphreyja