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 關注
- 778 瀏覽
添加回答
舉報