My iPhone produces corrupted images under certain conditions. If I shoot same scene (with slightly varying angle) in same lightning conditions, I almost all the time receive corrupted photo, which contains magenta copy of image and green rectangle. If I add some other objects to the scene, thus changing overall brightness of the scene, chance of bug reduces significantly.
Device info: iPhone 14 Pro Max (iOS 17 RC), iPhone 14 Pro (iOS 17 beta 6)
Images with issue:
f/1.664, 1/25s, ISO 500, digitalZoom=1.205, brightness=-0.568
f/1.664, 1/25s, ISO 500, digitalZoom=1.205, brightness=-0.514
f/1.664, 1/25s, ISO 640, digitalZoom=1.205, brightness=-0.641
f/1.664, 1/25s, ISO 500, digitalZoom=1.205, brightness=-0.448
f/1.664, 1/25s, ISO 500, digitalZoom=1.205, brightness=-0.132
Images without issue:
f/1.664, 1/25s, ISO 500, digitalZoom=1.205, brightness=-0.456
f/1.664, 1/20s, ISO 640, digitalZoom=1.205, brightness=-1.666
f/1.664, 1/100s, ISO 50, digitalZoom=1.205, brightness=4.840
f/1.664, 1/25s, ISO 640, digitalZoom=1.205, brightness=-0.774
I'm using builtInWideAngleCamera with continuousAutoExposure, continuousAutoFocus and slight videoZoomFactor
func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) {
if let error = error {
capturePhotoCallback?(.failure(.internalError(error.localizedDescription)))
return
}
guard let data = photo.fileDataRepresentation() else {
capturePhotoCallback?(.failure(.internalError("Can not get data representation.")))
return
}
guard let image = UIImage(data: data) else {
capturePhotoCallback?(.failure(.internalError("Can not get image from data representation.")))
return
}
capturePhotoCallback?(.success(image))
}