Skip to content
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

💭 Why the Photo Result Does Not Come Out in the Specified Aspect Ratio #2894

Closed
3 of 4 tasks
seereal-beomjin opened this issue May 21, 2024 · 1 comment
Closed
3 of 4 tasks
Labels
💭 question Further information is requested

Comments

@seereal-beomjin
Copy link

Question

When I set photoAspectRatio to 1/1 and photoResolution to 3048, which is a 1:1 ratio, and take a picture, the resulting width and height do not come out at 1:1.

I'm using samsung galaxy s10

What I tried

const format = useCameraFormat(device, [
    {videoAspectRatio: ratio}, // 1:1
    {photoAspectRatio: ratio}, // 1:1 
    {photoResolution: {width: 3048, height: 3048}},
  ]);

the output is

{"height": 288, "isMirrored": false, "isRawPhoto": false, "orientation": "landscape-left", "path": "/data/user/0/com.../cache/mrousavy2801553129656230601.jpg", "width": 352}

VisionCamera Version

3.9.2

Additional information

@seereal-beomjin seereal-beomjin added the 💭 question Further information is requested label May 21, 2024
@mrousavy
Copy link
Owner

That's not how formats work. Please read the formats documentation. Formats is what your phone natively supports, 1:1 ratio is probably not natively supported as sensors are usually 4:3.

You need to crop the photo yourself after taking it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💭 question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants