-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Android - Taking picture with automatic flashlight #569
Comments
@mrousavy any update on this? |
Hey! I haven't had time to look into this yet. |
Hello, would it be possible to let me know if there is a plan to fix this, please? I always have the first picture black and others are fine. |
Hey again! I still haven't had time to investigate this, I am currently really busy with the agency I'm running (https://margelo.io). You can hire us to fix it, or put a bugbounty on this issue, but I don't really have any free time at the moment. Also, I don't have neither of those devices and for me (Huawei P10) the flash correctly fires. Maybe it is also a native CameraX library issue and you could try replicate it in a native Android app, and if it is, post an issue in the Google Issue Tracker for CameraX. |
To be precise, it is only the first attempt. The flash is not working only for the first picture when you open an app in complete darkness. Others are fine, but only the first one is not working. |
@mrousavy I think I found a solution - it seems that this code is not working correctly in the CameraView+TakePhoto.kt:
It looks like the flashMode should be set when creating the imageCapture !or! it has to be rebuilt somehow - sorry, I am not a Kotlin developer, but I am trying my best. I have changed your code in CameraView.kt this:
And it is working! I have no answer to the problem, but this is a solution. Can you please help me add flashMode as a parameter in the object? |
Hello, |
@mrousavy Please have a look at this change - it is working correctly |
Well yeah, but we want to set flash mode per photo capture, not on the Camera in the React lifecycle. |
OK, but as you can see, this is not working correctly on more devices. I think you will find more devices ... |
FWIW I'm seeing the same issue on a Xiaomi Mi9 and Samsung Galaxy S7 |
some device flash not working... |
Hey! I've rewritten the entire Android codebase of VisionCamera from CameraX to Camera2 in the efforts of ✨ VisionCamera V3. I just now completed the Camera2 rewrite and I believe the core structure is running, but there might be some edge cases to iron out. Can you try and test the PR #1674 for me to see if you can still reproduce this issue here? Here's an instruction on how you can test that: #1674 (comment) If the issue cannot be reproduced with that version/PR anymore, then hoorayy, I fixed it! 🎉 Thank you! |
What were you trying to do?
When I want to take the first picture in the darkness, the automatic flash is not working on Android. The second image is OK, the flash is flashing.
Reproduceable Code
What happened instead?
The first image is without flash and the second image is with flash. The same darkness, the same spot, 2s later.
Relevant log output
No response
Device
Samsung s10e, Huawei P30lite
VisionCamera Version
2.9.3
Additional information
The text was updated successfully, but these errors were encountered: