Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions Signal/src/ViewControllers/Photos/CameraCaptureSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1486,12 +1486,15 @@ private class PhotoCapture {
let avCaptureOutput = AVCapturePhotoOutput()

var flashMode: AVCaptureDevice.FlashMode = .off

init() {
init() {
avCaptureOutput.isLivePhotoCaptureEnabled = false
avCaptureOutput.isHighResolutionCaptureEnabled = true
}

if #available(iOS 13.0, *) {

avCaptureOutput.maxPhotoQualityPrioritization = .quality
}
}
private var photoProcessors: [Int64: PhotoProcessor] = [:]

func takePhoto(delegate: PhotoCaptureDelegate, captureOrientation: AVCaptureVideoOrientation, captureRect: CGRect) {
Expand All @@ -1502,10 +1505,19 @@ private class PhotoCapture {

avCaptureConnection.videoOrientation = captureOrientation

let photoSettings = AVCapturePhotoSettings()
let photoSettings = AVCapturePhotoSettings()
photoSettings.flashMode = flashMode
photoSettings.isHighResolutionPhotoEnabled = true

if #available(iOS 13.0, *) {

photoSettings.photoQualityPrioritization = .quality
}

if avCaptureOutput.isAutoRedEyeReductionSupported {
photoSettings.isAutoRedEyeReductionEnabled = true
}

let photoProcessor = PhotoProcessor(delegate: delegate, captureRect: captureRect) { [weak self] in
self?.photoProcessors[photoSettings.uniqueID] = nil
}
Expand Down