-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
fix: Fix PreviewView being stretched #2519
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@mrousavy Hi. Is this fix included in 3.9.0-beta.1? I installed beta version but this problem continue. |
@e-vural no, it is no. |
|
This is now included in v3.9.0-beta.2 🚀 |
Perfect! Tested and works fine. Thank you @mrousavy |
@mrousavy I'm testing it on an old Galaxy J5 but image preview is in landscape while device is in portrait mode making preview horizontally stretched. I'm using front camera |
Hi, I have an error: The camera showing in my app are stretching and dark in horizontal mode. I'm using the tablet named Samsung Tab A9+. My app are developed with React Native, this is my
|
* fix: Fix Preview stretching * feat: Keep screen on on Android * Add test code for race condition * fix: Fix preview stretching by awaiting SurfaceHolder resizing (`setFixedSize`) before configuring Camera * Format * Update SurfaceHolder+resize.kt * Update CameraPage.tsx
What
HUGE thanks to the GitHub sponsors who sponsored me to fix this bug! 💖
Fixes the PreviewView being stretched by awaiting the
SurfaceHolder
's size change before configuring the Camera session on Android.This will delay the Camera session startup time by a bit (130ms on my Huawei P10 for first init, 20ms afterwards), so #2518 is becoming even more relevant now.
I am not sure if there is another way to do this, but it seems like we really need to wait for the Surface View to resize properly before configuring the Camera with it. Weird.
Also prevents the display from going to sleep while the Camera is active, as an addition to #2421
Changes
getMaximumPreviewSize()
dimensions to reflect sensor natural orientationTested on
Related issues