-
-
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Photo is not what is in the preview #2843
Comments
I tried scanning through the codebase and there doesn't seem to be any resizing happening - was this just a feature of 2.x that is no longer carried over? |
Would mind clarify what is actually happening (and what is wrong there)? Are you sure you are selecting the right |
@mrousavy: I added logs via editing, you may have been looking at the email. That said, I'm not quite sure it's the logs you want. You are right about the example app, I can give it a shot later today. I also haven't tried If I had to re-describe the problem: I set up the camera with a 4:3 aspect ratio "preview", but when I take the photo, I get something as if the preview was my whole camera screen. Here is what the preview looks like: Here is what the photo ends up looking like: You can see that in the preview, my webcam was not there, but the photo contains my webcam. |
Those are not native logs - I need the native logs (from Xcode or Android Studio) - those will tell me what format actually gets selected. But yes I can answer that question right away then;
The preview view has nothing to do with the photo output - previously in V2 it might have had something to do with it, but now this is fully decoupled (preview can even be disabled with Maybe try something like: const format = useCameraFormat(device, [
{ photoAspectRatio: 4 / 3 }, // or 3 / 4, can't remember which way, sorry
{ photoResolution: 'max' }
]) |
btw nice mic, is that the blue jeti? I have the same |
Ah okay, in V2 the preview is exactly what you got when you took the photo, so those two being disconnected concepts is exactly the issue. I tried your tip with the Any thoughts on how I'd go about ensuring that the bounds of the preview are exactly the same as the photo I take? And yeah, that's a Blue Yeti. We had some in the office before the pandemic and I was able to take one home. I hate wearing headphones all day, and the mic does a surprising job of not picking up the speaker output to cancel out echo. |
Well yea, make sure your preview is exactly the same aspect ratio as one of the photo sizes. The But what you wanna do is figure out which format you want to use, then resize your preview accordingly. or just account for slight aspect ratio mismatches, which is what pretty much every camera app does. |
I have a similar issue after upgrading to v4 from v3. I have my format set to I have a react native view set with its aspect ratio of 9 / 16 for the Preview. But my preview (set with resizeMode='contain') has blackbars in v4, and when the photo is taken i see extra padding just like what @inssein is noticing. (This on a pixel 6 pro, "react-native-vision-camera": "^4.0.3") |
Preview uses a video stream. So video resolution is what counts. |
What's happening?
I just upgraded from 2.x to 4.x to test the new release (not upgrading to new architecture yet).
My camera app intentionally has a view with a 4:3 aspect ratio, but when I execute
takePhoto
, I seem to get a portrait photo back.Reproduceable Code
Relevant log output
Camera Device
All devices on my iPhone 14 Pro Max
Device
iPhone 14 Pro Max
VisionCamera Version
4.0.1
Can you reproduce this issue in the VisionCamera Example app?
I didn't try (鈿狅笍 your issue might get ignored & closed if you don't try this)
Additional information
The text was updated successfully, but these errors were encountered: