Capture photo using photooutput, the size of the picture changes at random

415 Views Asked by At

Testing with iPhone XS, sessionPreset is set to photo. The picture resolution is usually 4032x3024, but sometimes it is taken at 3088x1938. What's the reason?

Below is my code.

let photoSettings = AVCapturePhotoSettings(format: [kCVPixelBufferPixelFormatTypeKey as String: Int(kCVPixelFormatType_32BGRA)])
photoSettings.isHighResolutionPhotoEnabled = true
photoSettings.isAutoStillImageStabilizationEnabled = true
photoSettings.flashMode = self.flashMode
self.photoOutput.capturePhoto(with: photoSettings, delegate: self)
0

There are 0 best solutions below