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

Rotate photo to always portrait #42

Open
oxnnj opened this issue Jun 3, 2022 · 0 comments
Open

Rotate photo to always portrait #42

oxnnj opened this issue Jun 3, 2022 · 0 comments

Comments

@oxnnj
Copy link

oxnnj commented Jun 3, 2022

How do I take photo always in portrait mode even if the device is in landscape or orientation lock is enabled or not all I want is to take photo in portrait mode.

Settings I have done:

photoSession.session.sessionPreset = .photo
        photoSession.flashMode = .auto
        
        previewView.session = self.photoSession
        previewView.autorotate = false
        previewView.previewLayer?.videoGravity = .resizeAspectFill

Taken in landscape mode and device orientation is locked:

Screen Shot 2022-06-03 at 12 51 21 PM

Taken in landscape mode but device orientation is unlocked:
Screen Shot 2022-06-03 at 12 52 02 PM

@oxnnj oxnnj changed the title Rotate photo to always portrai Rotate photo to always portrait Jun 3, 2022
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

1 participant