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

Resolution property not working! #14

Open
idesignzone opened this issue Oct 20, 2022 · 3 comments
Open

Resolution property not working! #14

idesignzone opened this issue Oct 20, 2022 · 3 comments

Comments

@idesignzone
Copy link

Hello.
Thank you for the handy plugin. However when I am on mobile device and open the camera, size of the view seems to be fixed and resolution property don't have any effect on it.
Any suggestions to edit the snapshot size on mobile camera?

@idesignzone idesignzone changed the title Resolution property not working with mobile camera! Resolution property not working! Oct 20, 2022
@BastiaanJansen
Copy link
Owner

On what devices are you experiencing this problem?

@vito-vanhecke
Copy link

@BastiaanJansen
Hi I have this scaling problem that I don't know how to solve.
Please look at the picture below:
Screenshot 2024-01-18 at 12 39 41

When taking a picture, the picture is not the same aspect ratio as the preview.
I thought I could fix this by setting the resolution property, but that does not work...
Any thoughts on this?

@rammzess13
Copy link

rammzess13 commented May 28, 2024

@BastiaanJansen Hi I have this scaling problem that I don't know how to solve. Please look at the picture below: Screenshot 2024-01-18 at 12 39 41

When taking a picture, the picture is not the same aspect ratio as the preview. I thought I could fix this by setting the resolution property, but that does not work... Any thoughts on this?

I had same issue for portrait orientation. Fixed it by setting static resolution for Camera component whatever the orientation is:
<Camera :resolution="{ width: 1280, height: 720 }" />

and dynamic while taking snapshot:

function calculateResolution () {
  const ratio = window.innerWidth / window.innerHeight

  if (ratio > 1) {
    return { width: 1280, height: 720}
  } else {
    return { width: 720, height: 1280}
  }
}

const blob = await camera.value?.snapshot(calculateResolution(), 'image/jpeg', 0.8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants