Applying metadata to image causes performChanges request to fail

前端 未结 5 622
感动是毒
感动是毒 2021-02-06 15:29

I am using PhotoKit to edit photos and I need to preserve the metadata from the original photo. To do so I save the metadata then provide it to the options paramete

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-06 16:08

    // if the asset does not allow the type of change requested, these methods will raise an exception, call canPerformEditOperation: on the asset to determine if the type of edit operation is allowed.

    • (instancetype)changeRequestForAsset:(PHAsset *)asset;

    I think it's because Apple don't want you to change the metaData.You can try this method below,maybe create a new one is allowed.

    • (instancetype)creationRequestForAssetFromImage:(UIImage *)image;
    • (instancetype)creationRequestForAssetFromImageAtFileURL:(NSURL *)fileURL;
    • (instancetype)creationRequestForAssetFromVideoAtFileURL:(NSURL *)fileURL;

提交回复
热议问题