CameraKit / camerakit-ios

Library for iOS Camera API. Massively increase performance and ease of use within your next iOS Project.
Apache License 2.0
686 stars 82 forks source link

Rotate photo to always portrait #42

Open oxnnj opened 2 years ago

oxnnj commented 2 years ago

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