0

I see that iOS 10 introduces AVCapturePhotoOutput as the new class to deal with capturing photo's and has the ability to create a preview/thumbnail image alongside the main image by passing two buffers to the AVCapturePhotoCaptureDelegate method capture.

This can then be represented as JPEG data through jpegPhotoDataRepresentation, however I'm intrigued and unable to find out how the preview image is stored then accessed. I'm guessing a UIImageView would automatically select either image dependant upon view bounds? How would you go about manually selecting either image?

let imageData = AVCapturePhotoOutput.jpegPhotoDataRepresentation(forJPEGSampleBuffer: photoSampleBuffer, previewPhotoSampleBuffer: previewPhotoSampleBuffer)
captureImageView.image = UIImage(data: imageData)
Leon Storey
  • 3,274
  • 2
  • 25
  • 40
  • Check the answer of this thread: http://stackoverflow.com/questions/37869963/how-to-use-avcapturephotooutput –  Jan 23 '17 at 00:20

1 Answers1

0

Yes, the thumbnail is embedded in the header for the full size JPEG image. For more information, you can check out: https://en.m.wikipedia.org/wiki/JPEG_File_Interchange_Format

Dave Weston
  • 6,527
  • 1
  • 29
  • 44