I create an image at url provided by PHContentEditingOutput
. When I load data to UIImage
and save it like this - it works.
[[PHPhot
The problem is in the file format. I was trying to edit PNG screenshot, but renderingContentURL
was always tmp/filename.JPG. At first I thought it was a bug, but according to the documentation this is correct behaviour.
Read this property to find a URL for writing edited asset content. Then, if editing a photo asset, write the altered photo image to a file in JPEG format at this URL. If editing a video asset, export the video to a QuickTime (.mov) file at this URL.
The solution is to convert the image with function
NSData *UIImageJPEGRepresentation(UIImage *image, CGFloat compressionQuality);