Skip to content

KeepAspectRatio, sizes and orientation #98

Closed

Description

@carrbrpoa

Hello,

As and enhancement, is it possible that width and height could be treated conditionally when KeepAspectRatio is set to true, depending on camera orientation when photo is taken?

Motive: let's say I have the following options setted:

takePicture({
	width: 640,
	height: 480,
	keepAspectRatio: true,
...

As a result, I see that landscape/horizontal photo I take, is like 576x324 (Ok case).

Also see that portrait/vertical photo is 648x1152 (because of the "rule" that says that only one of width/height could be respected with keepAspectRatio: true), but actually, in this case, would be better for me to specify that when taking portrait photo, I would like to have maybe width: 480 and height: 640.

Activity

  1. self-assigned this
    on Nov 2, 2018
  2. elena-p commented on Nov 6, 2018

    @elena-p
    Contributor

    AC:

    • When keepAspectRatio is set to true, treat provided width and height according to screen orientation - in landscape use the bigger of the two values as width and in portrait use the bigger of the two values as height
    • When keepAspectRatio is set to false, provide image with the specified dimensions regardless of the screen orientation (current behaviour)
    • Demo and angular demo should be updated with options to enter keepAspectRatio, width and height; The demos should display width, height and scale of the taken image
  3. zbranzov commented on Nov 9, 2018

    @zbranzov
    Contributor

    The feature is released in nativescript-camera@4.1.0. Enjoy!

  4. ghost removed on Nov 9, 2018
  5. carrbrpoa commented on Nov 9, 2018

    @carrbrpoa
    Author

    The feature is released in nativescript-camera@4.1.0. Enjoy!

    Actually since I suggested that, I needed to embed the camera with another plugin, because sometimes my app was being "chosen" to be killed in low resources device, when it was to switch to camera app. I know it's Android's behavior, so it was the solution I found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions