如何在iOS 4.0+中从相机拍摄的照片中访问照片EXIF? [英] How to access photo EXIF in pictures taken from camera in iOS 4.0+?
问题描述
如何使用新的4.0 / 4.1 API访问来自相机的图片中的EXIF信息?
我使用 _captureStillImageAsynchronouslyFromConnection_
拍摄照片和:
[AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageDataSampleBuffer];
获取jpg数据,但如何提取EXIF?
doco引用包含EXIF的 imageDataSampleBuffer
(如果我在控制台中检查变量,我可以看到它):
缓冲区附件可以包含适合于图像数据格式的元数据,例如,包含JPEG数据的缓冲区可以携带 kCGImagePropertyExifDictionary
作为附件
但我无法弄清楚如何操作CMSampleBufferRef来获取它。
感谢。
iOS4中引入的Image I / O框架允许读取EXIF属性从
链接:CGImageSource参考 - 请查看 CGImageSourceCopyPropertiesAtIndex
函数。 / p>
How do I access the EXIF info in a picture from the camera taken using the new 4.0/4.1 APIs?
I use _captureStillImageAsynchronouslyFromConnection_
to take the picture and:
[AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageDataSampleBuffer];
to get the jpg data but how do I extract the EXIF?
The doco makes references to imageDataSampleBuffer
containing EXIF (I can see it in there if I examine the variable in the console):
"The buffer attachments may contain metadata appropriate to the image data format. For example, a buffer containing JPEG data may carry a kCGImagePropertyExifDictionary
as an attachment"
But I can't figure out how to manipulate a CMSampleBufferRef to acces it.
Thanks.
The Image I/O Framework which was introduced in iOS4 allows one to read EXIF properties from a picture according to the documentation.
Link: CGImageSource Reference - have a look at the CGImageSourceCopyPropertiesAtIndex
function.
这篇关于如何在iOS 4.0+中从相机拍摄的照片中访问照片EXIF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!