【问题标题】:Getting picture data from iOS photo gallery从 iOS 相册中获取图片数据
【发布时间】:2012-09-10 06:32:16
【问题描述】:

我需要从 iOS 照片库中存储的图像中获取元数据(EXIF 和其他)。因此我需要原始图片数据而不是 UIImage 对象。

目前我使用 imagepickercontroll 和 ALAssetsLibrary 获取资产图像 url,如下所述:display image from URL retrieved from ALAsset in iPhone

此 url 可用于获取 UIImage 对象,但如何获取原始图像以便处理它的元数据?

问候,

【问题讨论】:

标签: iphone objective-c ios ios5


【解决方案1】:

ALAssetsLibrary 检索所有图像here

ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library assetForURL:assetURL
resultBlock:^(ALAsset *asset)  {
    NSDictionary *metadata = asset.defaultRepresentation.metadata;
    imageMetadata = [[NSMutableDictionary alloc] initWithDictionary:metadata];
    [self addEntriesFromDictionary:metadata];
}
failureBlock:^(NSError *error) {
}];
[library autorelease];

参考更多getting-metadata-from-images-on-ios 链接并获得帮助。

【讨论】:

  • 谢谢。但我确实需要原始文件数据。正如 Ben 发布的链接中提到的那样,这似乎只有使用私有 API 才有可能。
  • 检查编辑的答案books.google.co.in/…
猜你喜欢
  • 2013-01-11
  • 1970-01-01
  • 2015-02-28
  • 1970-01-01
  • 1970-01-01
  • 2013-09-16
  • 2016-09-20
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多