3 回答
TA贡献1817条经验 获得超6个赞
这些答案看起来都非常复杂。如果图像已保存到相机胶卷,并且您有ALAsset(来自UIImagePicker或ALAssetLibrary),您可以获得如下元数据:
asset.defaultRepresentation.metadata;
如果要将图像从相机胶卷保存到另一个位置(例如在Sandbox / Documents中),只需执行以下操作:
CGImageDestinationRef imageDestinationRef = CGImageDestinationCreateWithURL((__bridge CFURLRef)urlToSaveTo, kUTTypeJPEG, 1, NULL);
CFDictionaryRef imagePropertiesRef = (__bridge CFDictionaryRef)asset.defaultRepresentation.metadata;
CGImageDestinationAddImage(imageDestinationRef, asset.defaultRepresentation.fullResolutionImage, imagePropertiesRef);
if (!CGImageDestinationFinalize(imageDestinationRef)) NSLog(@"Failed to copy photo on save to %@", urlToSaveTo);
CFRelease(imageDestinationRef);
- 3 回答
- 0 关注
- 747 浏览
添加回答
举报