在我的应用程序中,我需要从特定的URL链接下载图像并将其分配给UIImageView
。我没有将该图像存储到我的媒体库中,那么在这种情况下,如何在我的应用程序中获取该图像(例如EXIF_TAG_CREATE_DATE
,EXIF_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/