本文介绍了如何从下载的图像中获取Exif数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中,我需要从特定URL链接下载图像并将其分配给 UIImageView
。我没有将该图像存储到我的库中,然后在这种情况下如何获取此图像的 Exif数据(例如 EXIF_TAG_CREATE_DATE
,<$我的应用程序中有c $ c> EXIF_TAG_ARTIST 等)?
In my application , I need to download the image from particular URL Link and assign that to UIImageView
. I do not store that image to my Library, then in this case how can I get the Exif data of this image (like EXIF_TAG_CREATE_DATE
, EXIF_TAG_ARTIST
, etc) in my app?
推荐答案
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"]);
这篇关于如何从下载的图像中获取Exif数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!