Closed sralmu closed 5 years ago
Yes, but here https://github.com/mitchtabian/TabianCustomCamera/issues/13 the problem you solved was related to the onTouch method, which I haven't include in my code yet, and the distortion issue wasn't solved, I think.
However, I've just tested the last branch of your code (just in case I copied something wrong), and the problem persists.
Finally, I've found that the problem is not the code itself. The problem is related to Android Camera2 API for some reason.
This is what I've found: https://stackoverflow.com/questions/43319318/android-camera2-api-preview-sometimes-distorted
Modifying the openCamera method in order to delay the camera opening fixes the issue.
Thanks for sharing your findings
Hey Mitch! First of all, thanks for the course and all the code you've done, it's helping me a lot with an university project.
I'm having some problems to get a well proportioned preview before capturing the image.
Here's my phone test (Huawei P8 Lite, ALE-L21):
Well, the thing is, when I first install the app and open it, the preview is well proportioned as you can see in this screenshot:
This is the LogCat the first time I open the app:
However, if I close the app and open it again, the preview is distorted:
But the LogCat seems exactly the same:
And the most strange thing is, if now I exit the app (but leaving it in the background, not closing it definitely) and enter again, the preview is OK! And the LogCat I obtain is this:
Also, this distortion has nothing to do with the captured image, which is always well proportioned despite the preview is OK or not. This is how the image looks like:
I really don't know where the problem is, but obviously it has something to do with whether I close the app or leave it at the background (although the fact that it works well when I first install it is driving me crazy). In both cases, I think the program takes the same resolutions because of the log messages I obtain, so I don't know which is the difference.
Thanks in advance, it is very important for me to solve it.