Change deprecated photo resolution code

This commit is contained in:
Christoph Hagen 2023-04-17 14:18:30 +02:00
parent 9a6859686c
commit 0e2b0b42ff

View File

@ -115,7 +115,13 @@ class CameraManager: ObservableObject {
return return
} }
session.addOutput(photoOutput) session.addOutput(photoOutput)
photoOutput.isHighResolutionCaptureEnabled = true let maxFormat = camera.formats
.reduce(into: []) { $0.append(contentsOf: $1.supportedMaxPhotoDimensions) }
.max { $0.width * $0.height < $1.width * $1.height }
if let maxFormat {
photoOutput.maxPhotoDimensions = maxFormat
}
//photoOutput.isHighResolutionCaptureEnabled = true
photoOutput.isDepthDataDeliveryEnabled = false photoOutput.isDepthDataDeliveryEnabled = false
photoOutput.isLivePhotoCaptureEnabled = false photoOutput.isLivePhotoCaptureEnabled = false