iphone - 如何从下载的图像中获取Exif数据

标签 iphone ios objective-c ios6

在我的应用程序中,我需要从特定的URL链接下载图像并将其分配给UIImageView。我没有将该图像存储到我的媒体库中,那么在这种情况下,如何在我的应用程序中获取该图像(例如EXIF_TAG_CREATE_DATEEXIF_TAG_ARTIST等)的 Exif数据?

最佳答案

try this  

NSError *error = nil;
NSDictionary *attributes = [[NSFileManager defaultManager] 
    attributesOfItemAtPath:@"imagePath" error:&error];

if (!error) 
{
    NSLog(@"file attributes : %@",attributes);
}

and this is the result :

NSFileCreationDate = "2013-05-28 09:29:37 +0000";
NSFileExtensionHidden = 0;
NSFileGroupOwnerAccountID = 20;
NSFileGroupOwnerAccountName = staff;
NSFileModificationDate = "2013-05-28 09:29:37 +0000";
NSFileOwnerAccountID = 502;
NSFileOwnerAccountName = lerhan;
NSFilePosixPermissions = 420;
NSFileReferenceCount = 1;
NSFileSize = 1494;
NSFileSystemFileNumber = 46795419;
NSFileSystemNumber = 234881026;
NSFileType = NSFileTypeRegular;

to access any data type NSLog(@"file creation date : %@",[attributes objectForKey:@"NSFileCreationDate"]);

关于iphone - 如何从下载的图像中获取Exif数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16830180/

相关文章:

ios - 关于在 iOS 中使用 Google Maps SDK 跟踪路线

iphone - 如何更改按钮的图像?

ios - 即使成功切换到前置摄像头,iPhone 仍然显示后置摄像头的 View

iphone - 如何使用 Xcode 4 注册自定义应用程序打开 URL 方案?

objective-c - 确保方法仅由主线程执行

ios - 特殊字符串格式的 ObjC 注册应用程序

iphone - 无法在设备上运行代码

iphone - 在 iOS7 中处于编辑模式时更改 uitableviewcell 'delete' 部分的颜色

objective-c - iOS 中的 Mac OS X 快速用户切换

objective-c - 如何在 OS X 上的 Objective C/C 中获取总 CPU 空闲时间?