---
title: "photoOutput(_:didFinishProcessingPhoto:previewPhoto:resolvedSettings:bracketSettings:error:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avcapturephotocapturedelegate/photooutput(_:didfinishprocessingphoto:previewphoto:resolvedsettings:bracketsettings:error:)"
---

# photoOutput(_:didFinishProcessingPhoto:previewPhoto:resolvedSettings:bracketSettings:error:)

Provides the delegate a captured image in a processed format (such as JPEG).

## Declaration

```swift
optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photoSampleBuffer: CMSampleBuffer?, previewPhoto previewPhotoSampleBuffer: CMSampleBuffer?, resolvedSettings: AVCaptureResolvedPhotoSettings, bracketSettings: AVCaptureBracketedStillImageSettings?, error: (any Error)?)
```

## Parameters

- `output`: The photo output performing the capture.
- `photoSampleBuffer`: A sample buffer containing the captured photo, either as uncompressed pixel buffer or compressed image data (see the doc://com.apple.avfoundation/documentation/AVFoundation/AVCapturePhotoSettings/format property of your photo settings object), along with timing information and other metadata. If an error prevented successful capture, this parameter is nil—see the error parameter for a description of the failure.
- `previewPhotoSampleBuffer`: If you requested a thumbnail-sized version of the photo (with the doc://com.apple.avfoundation/documentation/AVFoundation/AVCapturePhotoSettings/previewPhotoFormat property of your photo settings object), a sample buffer containing the thumbnail photo in the requested format. If you did not request preview delivery, or if an error prevented capture, this parameter is nil.
- `resolvedSettings`: An object describing the settings used for this capture. Match this object’s doc://com.apple.avfoundation/documentation/AVFoundation/AVCapturePhotoSettings/uniqueID value to the doc://com.apple.avfoundation/documentation/AVFoundation/AVCapturePhotoSettings/uniqueID property of the photo settings object you initiated capture with to determine which capture request this delegate call corresponds to. You can also use this object to find out which values the photo output has chosen for automatic settings.
- `bracketSettings`: If you requested a bracketed capture of multiple images with a doc://com.apple.avfoundation/documentation/AVFoundation/AVCapturePhotoBracketSettings, a bracketed still image settings object describing which image in the bracket this delegate call corresponds to. If you did not request bracketed capture, this parameter is nil.
- `error`: If an the capture process could not proceed successfully, an error object describing the failure; otherwise, nil.

## Discussion

Discussion Use this method to receive the results of photo capture in a processed format such as JPEG. (If you request capture in both RAW and a processed format, the photo output calls both this method and the photoOutput(_:didFinishProcessingRawPhoto:previewPhoto:resolvedSettings:bracketSettings:error:) method.) important: You must implement either this method or the photoOutput(_:didFinishProcessingPhoto:error:) method if you request capture in a processed format. The photo output validates this requirement when you call its capturePhoto(with:delegate:) method; if your delegate does not implement the correct methods, the photo output raises an exception. If you request capture in a processed format, the photo output calls this method once for each exposure in the capture request. If you request a single image capture, this method is called once. If you request a bracketed capture with multiple exposures, this method is called once for each exposure.

## See Also

### Receiving capture results

- [photoOutput(_:didFinishProcessingPhoto:error:)](avfoundation/avcapturephotocapturedelegate/photooutput(_:didfinishprocessingphoto:error:).md)
- [photoOutput(_:didFinishRecordingLivePhotoMovieForEventualFileAt:resolvedSettings:)](avfoundation/avcapturephotocapturedelegate/photooutput(_:didfinishrecordinglivephotomovieforeventualfileat:resolvedsettings:).md)
- [photoOutput(_:didFinishProcessingLivePhotoToMovieFileAt:duration:photoDisplayTime:resolvedSettings:error:)](avfoundation/avcapturephotocapturedelegate/photooutput(_:didfinishprocessinglivephototomoviefileat:duration:photodisplaytime:resolvedsettings:error:).md)
- [photoOutput(_:didFinishCapturingDeferredPhotoProxy:error:)](avfoundation/avcapturephotocapturedelegate/photooutput(_:didfinishcapturingdeferredphotoproxy:error:).md)
- [photoOutput(_:didFinishProcessingRawPhoto:previewPhoto:resolvedSettings:bracketSettings:error:)](avfoundation/avcapturephotocapturedelegate/photooutput(_:didfinishprocessingrawphoto:previewphoto:resolvedsettings:bracketsettings:error:).md)
