iOS 8 GM: -[ALAssetRepresentation getBytes:fromOffset:length:error:] returns adjusted image content, sometimes as a thumbnail
| Originator: | stephenpoletto | ||
| Number: | rdar://18339818 | Date Originated: | 15-Sep-2014 11:50 AM |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 8.0 (12A365) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: Under the iOS 7 SDK, -[ALAssetRepresentation getBytes:fromOffset:length:error:] is documented to return "the biggest, best representation available, unadjusted in any way". Developers have written applications under the contract of this documentation, with the expectation that for filtered photos (i.e. photos with XMP edit metadata associated with them), this call will return the original, unedited version of the photo. Now, under the iOS 8 SDK, this call returns flattened image content. That is, for photos taken on an iOS 8 device with a filter, -[ALAssetRepresentation getBytes:fromOffset:length:error:] is returning photo content equivalent to PHImageRequestOptionsVersionCurrent. This breaks forward compatibility of the AssetsLibrary API and leaves developers without a mechanism to access full photo content using the iOS 7 SDK. Since real-world applications have clients running in the wild compiled against the iOS 7 SDK, this will break existing applications when users upgrade to iOS 8. Steps to Reproduce: 1. Open the camera app and take a photo with a filter applied. 2. Using the attached sample project, capture the photo contents via -[ALAssetRepresentation getBytes:fromOffset:length:error:] and write to file. Repeat steps (1) and (2) by deploying to a device running iOS 7. Expected Results: The image data returned by -[ALAssetRepresentation getBytes:fromOffset:length:error:] on iOS 8 should match what is returned on iOS 7. That is, the call should return the data unmodified. Actual Results: The image data returned on iOS 8 is a flattened version of the photo, with edits destructively applied. Version: 8.0 (12A365) Notes: Configuration: iPhone 5 Attachments: 'SPPhotoLibraryData.zip' was successfully uploaded.
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!
I have filed rdar://18341805 as a follow-up, identifying the underlying bug that causes a thumbnail to be returned.
Note that this problem is made worse by the fact that sometimes this call returns the flattened content, not in high resolution form, but as a thumbnail. This seems to happen if you make the call shortly after taking the photo.