PHAsset.pixelWidth & pixelHeight does not give correct size for images in iCloud

Originator:an00na
Number:rdar://21045111 Date Originated:20-May-2015 04:07 PM
Status:Open Resolved:
Product:iOS SDK Product Version:8.3
Classification:Serious Bug Reproducible:Always
 
Summary:
For images in iCloud and not downloaded yet, PHAsset.pixelWidth & pixelHeight gives a size much smaller than the full image’s size if it is downloaded. It seems to be the size of a thumbnail version of the image which is useless as a meta data.

I’m using traditional iCloud stream and none of my devices turn on iCloud Photo Library. I’m not sure whether this bug also exists in that environment. Please test in a similar environment to mine.

Steps to Reproduce:
1. Launch sample app.
2. Grant permission.
3. Relaunch sample app.
4. Read console logs: (album, index, width, height)
5. Find an image and open it in Photo.app using album name and index. Let the download finish. It’s easy to tell that the full image is much larger than the reported size from PHAsset.
6. Relaunch sample app.
7. Find the just downloaded image using album name and index in console logs. See that the reported size is now correct.

Expected Results:
PHAsset.pixelWidth & pixelHeight should give the size of full image even if the full image is not downloaded yet.

Actual Results:
PHAsset.pixelWidth & pixelHeight gives the size of a thumbnail version of the image if the full image is not downloaded yet.

Sample code:
http://cl.ly/2g02083G0W3O

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!