How to access EXIF ​​photos in photos taken from the camera in iOS 4.0+?

How do I access EXIF ​​information in a camera picture taken using the new API 4.0 / 4.1?

I use _captureStillImageAsynchronouslyFromConnection_ to take a snapshot and:

 [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageDataSampleBuffer]; 

to get jpg data, but how to extract EXIF?

Doco makes links to imageDataSampleBuffer containing EXIF ​​(I can see it there if I examine the variable in the console):

"Buffer attachments may contain metadata appropriate to the image data format. For example, a buffer containing JPEG data may contain kCGImagePropertyExifDictionary as an attachment."

But I cannot figure out how to manipulate CMSampleBufferRef to get it.

Thanks.

+4
source share
3 answers

The I / O Image frame, which was introduced in iOS4, allows you to read EXIF ​​properties from an image in accordance with the documentation.

Link: CGImageSource Reference - look at the CGImageSourceCopyPropertiesAtIndex function.

+5
source

This library may be useful.

0
source

You will need to actually save the image in the photo library so that EXIF ​​data is added to the image. After that, you can use ALAssetLibrary to extract the image along with EXIF ​​information.

0
source

All Articles