“{Exif}”是什么意思?从 [NSArray objectAtIndex:] 指示
我正在寻找是否可以弄清楚如何从我的 iPhone 捕获的图像中访问 Exif 元数据信息。苹果文档似乎缺乏我正在寻找的必要信息。我可能会愚蠢地处理这个问题,但我对 iPhone 编程和 Objective-C 还比较陌生,所以我仍在弄清楚一切。
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
//EXPERIMENTATION
NSDictionary *metadata = [info objectForKey:UIImagePickerControllerMediaMetadata];
NSArray *metaDataKeys = [metadata allKeys];
for (NSUInteger i=0; i [metaDataKeys count]; i++)
{
NSLog(@"%@", [metaDataKeys objectAtIndex:i]);
}
此代码产生以下输出:
2010-10-21 14:42:56.354 _[3607:307] DPIHeight
2010-10-21 14:42:56.355 _[3607:307] {Exif}
2010-10-21 14:42:56.356 _[3607:307] DPI宽度
2010-10-21 14:42:56.357 _[3607:307] 迎新
2010-10-21 14:42:56.358 _[3607:307] {TIFF}
“{Exif}”表示什么?键实际上是字符串“{Exif}”吗?我猜不会,因为当我尝试使用该密钥提取该对象时,我收到了 NULL。当我最终从 NSDictionary 中获取 Exif 标签时,有人知道它是什么类型吗?是否有任何文档有助于学习如何使用 Exif 标签?谢谢!
I'm on a quest to see if I can figure out how to access Exif Metadata information from an image captured by my iphone. The apple documentation seems to lack the necessary information I'm looking for. I'm probably going about this stupidly, but I'm relatively new to iPhone programming and objective-c so I'm still figuring everything out.
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
//EXPERIMENTATION
NSDictionary *metadata = [info objectForKey:UIImagePickerControllerMediaMetadata];
NSArray *metaDataKeys = [metadata allKeys];
for (NSUInteger i=0; i [metaDataKeys count]; i++)
{
NSLog(@"%@", [metaDataKeys objectAtIndex:i]);
}
This code produces the following output:
2010-10-21 14:42:56.354 _[3607:307] DPIHeight
2010-10-21 14:42:56.355 _[3607:307] {Exif}
2010-10-21 14:42:56.356 _[3607:307] DPIWidth
2010-10-21 14:42:56.357 _[3607:307] Orientation
2010-10-21 14:42:56.358 _[3607:307] {TIFF}
What does '{Exif}' indicate? Is the key literally a string "{Exif}"? I'm guessing no because when I try to extract that the object with that key I receive a NULL. And does anyone happen to know what type the Exif tag will be when I eventually get it from this NSDictionary? Is there any documentation anywhere that is helpful for learning how to work with Exif tags? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
EXIF = 可交换图像文件格式
http://en.wikipedia.org/wiki/Exchangeable_image_file_format
EXIF = Exchangeable Image File Format
http://en.wikipedia.org/wiki/Exchangeable_image_file_format
您可以直接记录字典:
这比像您一样列出键更简单(也更好),并且还显示它们的内容!
You can log dictionaries directly:
which is simpler (and better) than listing the keys like you do, and also shows their contents!