requestImageDataForAsset returning thumbnail for filtered images
| Originator: | RichWChan | ||
| Number: | rdar://27673422 | Date Originated: | 02-Aug-2016 |
| Status: | Open | Resolved: | |
| Product: | iOS | Product Version: | 8.0 and above |
| Classification: | Serious Bug | Reproducible: | Always |
Area:
Photos
Summary:
Calling -[PHImageManager requestImageDataForAsset:] may return a thumbnail image in cases where:
- Asset is a newly taken picture with filter applied
- Version specified as PHImageRequestOptionsVersionCurrent
- synchronous set to YES
The image returned may be a thumbnail even if delivery mode is set to PHImageRequestOptionsDeliveryModeHighQualityFormat. The info dictionary is not marked as degraded either.
Steps to Reproduce:
1. Use the Camera app to take a photo with filter applied
2. From an iOS app, make a requestImageDataForAsset: call to the Photos framework with options set as the following:
```
PHImageRequestOptions *requestOptions = [[PHImageRequestOptions alloc] init];
requestOptions.version = PHImageRequestOptionsVersionCurrent;
requestOptions.networkAccessAllowed = YES;
requestOptions.synchronous = YES;
requestOptions.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;
```
Expected Results:
As explained by the documentations for requestImageDataForAsset:, we expect that the resultHandler will be invoked with data containing the "full-sized image data for the specified asset".
Actual Results:
We receive a thumbnail of the rendered image, with an info dict containing the following:
```
{
PHImageFileDataKey = <PLXPCShMemData: 0x14587310> bufferLength=139264 dataLength=138423;
PHImageFileOrientationKey = 0;
PHImageFileSandboxExtensionTokenKey = "44b49d95b5b2768fd4af97cdd4463ffc29d95f51;00000000;00000000;0000001a;com.apple.app-sandbox.read;00000001;01000003;0000000000039b31;/private/var/mobile/Media/PhotoData/Mutations/DCIM/100APPLE/IMG_0019/Adjustments/SubstandardFullSizeRender.jpg";
PHImageFileURLKey = "file:///var/mobile/Media/PhotoData/Mutations/DCIM/100APPLE/IMG_0019/Adjustments/SubstandardFullSizeRender.jpg";
PHImageFileUTIKey = "public.jpeg";
PHImageResultDeliveredImageFormatKey = 9988;
PHImageResultIsDegradedKey = 0;
PHImageResultIsInCloudKey = 0;
PHImageResultIsPlaceholderKey = 0;
PHImageResultOptimizedForSharing = 0;
PHImageResultWantedImageFormatKey = 9998;
}
```
The size of the image received is 138423 bytes vs the actual size of 1314598 bytes. The dimensions received is 640x852, vs the actual dimension of 2448x3264.
Version:
iOS 8.0, iOS 9.3.1
Notes:
The attached project contains a sample project that fetches the newest asset in the Photos library twice -- once synchronously and once asynchronously after the synchronous request finishes -- and compares the results.
When a new filtered photo is taken, opening the app will show a alert regarding the mismatch sizes.
Configuration:
iPhone 5
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!