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

Preserve aspect ratio #2

Closed
imhoffd opened this issue Jul 9, 2020 · 4 comments
Closed

Preserve aspect ratio #2

imhoffd opened this issue Jul 9, 2020 · 4 comments
Labels
enhancement New feature or request plugin: camera

Comments

@imhoffd
Copy link
Contributor

imhoffd commented Jul 9, 2020

Feature Request

Plugin

Camera

Description

Originally requested by @zyniq82 (ionic-team/capacitor#1952) with an unfinished implementation by @sandstrom (ionic-team/capacitor#2050).

The Camera plugin has strange default behavior when using width and height:

  • if I specify both width and height, I'm sure no side is too long, but then the aspect ratio of the resulting image is changed.
  • if I specify only width or height, the aspect ratio is retained, but then I don't know if my prescribed value is applied to the longer or shorter side of the image, since I don't know beforehand if the image is in portrait or landscape format.

-- @zyniq82

The default behavior should be to preserve the aspect ratio, even if both width and height are given (this is a breaking change from the core plugin). There can be an option to disable the default behavior, for example preserveAspectRatio (which would default to true).

Platform(s)

iOS, Android

@sandstrom
Copy link

I just want to add that not preserving the aspect ratio is a bug and I don't know of any camera plugin/sdk (native, cordova or otherwise) that wouldn't want to preserve aspect ratio of photos when resizing. I think adding a preserveAspectRatio option is a bad idea.

Thanks for opening the issue though, and for your work on Capacitor. I really like capacitor! 😄

@zyniq82
Copy link

zyniq82 commented Aug 28, 2020

With the inclusion of ionic-team/capacitor#3309 in Capacitor 2.4.0, I say this is now fixed 🙂
Thank you all for the participation! 🙏

@imhoffd
Copy link
Contributor Author

imhoffd commented Aug 28, 2020

Thanks! I created #24 to track the planned preserveAspectRatio default value change.

@imhoffd imhoffd closed this as completed Aug 28, 2020
kpatfln pushed a commit to kpatfln/capacitor-plugins that referenced this issue May 4, 2022
Animate splash screen using multiple images
PH-Lars added a commit to PH-Lars/capacitor-plugins that referenced this issue Aug 3, 2022
@ionitron-bot
Copy link

ionitron-bot bot commented Sep 30, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request plugin: camera
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants