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