如何将CR2 / NEF / RAW图像保存到相机胶卷(IOS)中的相册

时间:2017-01-25 03:27:34

标签: ios objective-c ios10

我有一张保存在沙盒中的CR2图像(由佳能DSLR拍摄),我想将它添加到相机胶卷中。所以我使用下面的方法,但它导致错误,没有描述。如何将CR2保存到相机胶卷?非常感谢!

[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
    // Request creating an asset from the image.
    PHAssetChangeRequest *createAssetRequest = [PHAssetChangeRequest creationRequestForAssetFromImageAtFileURL:[NSURL URLWithString:localPath]];
    // Request editing the album.
    PHFetchResult<PHAssetCollection *> *albumList = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary options:nil];
    PHAssetCollection *album;
    for(PHAssetCollection *am in albumList){
        if([am.localizedTitle isEqualToString:ALBUMN]){
            album = am;
        }
    }
    PHAssetCollectionChangeRequest *albumChangeRequest = [PHAssetCollectionChangeRequest changeRequestForAssetCollection:album];
    // Get a placeholder for the new asset and add it to the album editing request.
    PHObjectPlaceholder *assetPlaceholder = [createAssetRequest placeholderForCreatedAsset];
    [albumChangeRequest addAssets:@[assetPlaceholder]];
    } completionHandler:^(BOOL success, NSError *error) {
        NSLog(@"-=-=-=-Finished adding asset. %@", (success ? @"Success" : error));
    }];

输出消息:ImageIO:PluginForUTType:316:文件格式'com.canon.cr2-raw-image'不支持写入

0 个答案:

没有答案