问题描述:

I have updated this post on 10 April 2015 with new info ...

I have an App where I am copying the contents of a Cloud Photo album to a local Album on an IOS device. I am using the following code :

func fetchFullSizeImageForAsset(asset:PHAsset) -> (UIImage)? { // get the image from an asset ( could be nil )

var myImage:UIImage?

let requestOptions = PHImageRequestOptions()

requestOptions.synchronous = true

requestOptions.networkAccessAllowed = true

requestOptions.deliveryMode = .HighQualityFormat

let screenSize: CGSize = UIScreen.mainScreen().bounds.size

let targetSize = CGSizeMake(screenSize.width, screenSize.height)

let imageManager = PHImageManager()

imageManager.requestImageForAsset(asset as PHAsset, targetSize: targetSize, // targetSize: PHImageManagerMaximumSize, gives a null image !

contentMode: .AspectFit, options: requestOptions, resultHandler: {

(result, info) -> Void in

myImage = result

})

return myImage

}

My idea is to get myImage with the above code, and copy it to a new local album.

This gives me a low quality image (256 x 256) some of the time, but sometimes I get a high quality image (640 x 640).

I have looked at the Cloud Album images in the new Photos app on 10.10.3, and they are all high quality (640 x 640)

When I use photos to look at the shared album on the iPad, the images only become high quality when I click on them - which is the expected behaviour.

What is baffling me is that all these manually clicked images then import in high quality when I rerun my App !

Is this a bug in PhotoKit on IOS8 or am I missing something ?

相关阅读:
Top