我是靠谱客的博主 激昂发夹,这篇文章主要介绍IOS开发获取手机内照片属性,现在分享给大家,希望可以做个参考。

苹果获取多张照片时运用ALAsset相关方法

当获取到alasset 对像时可以通过 

CLLocation * wgs84Location = [asset valueForProperty:ALAssetPropertyLocation]; 获取到坐标信息


相应的 ALAssetPropertyDate 可以获取到照片的创建时间,此时间是照片在些设备的生成时间 。

如果想获取照片原始的拍摄时间 可以通过ALAsset 的defaultRepresentation.metadata属性

 NSDictionary *imageData = [[NSMutableDictionary alloc]initWithDictionary:asset.defaultRepresentation.metadata];

 NSDictionary *TIFFData = [imageData objectForKey:(NSString *)kCGImagePropertyTIFFDictionary];


//imagedate 的格式为2015:08:08 08:08:08

 NSString *imageDate=[TIFFData objectForKey:@"DateTime"];

 NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];

 [dateFormatter setDateFormat: @"yyyy:MM:dd HH:mm:ss"];

 NSDate *takeDate= [dateFormatter dateFromString:imageDate];


调用kCGImagePropertyTIFFDictionary需要头文件

#import <ImageIO/ImageIO.h>

CGImageProperties  可以获得到更多的照片属性



最后

以上就是激昂发夹最近收集整理的关于IOS开发获取手机内照片属性的全部内容,更多相关IOS开发获取手机内照片属性内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(96)

评论列表共有 0 条评论

立即
投稿
返回
顶部