I'm trying to get a photo's URL from a PHAsset
using this code.
let options: PHContentEditingInputRequestOptions = PHContentEditingInputRequestOptions()
options.canHandleAdjustmentData = {(adjustmeta: PHAdjustmentData) -> Bool in
return true
}
asset.requestContentEditingInput(with: options, completionHandler: { (contentEditingInput, info) in
guard let url = contentEditingInput?.fullSizeImageURL else {
observer.onError(PHAssetError.imageRequestFailed)
return
}
/// Using this `url`
})
Most of the photos are working well with this code.
When I take a photo in the Camera app and rotate the photo in the Photos app, then select the rotated photo in my app, this code returns the original photo URL -- not the rotated version.
How can I get the edited photo's local URL from PHAsset
?