(Photos Framework) No targetSize parameter in requesting requestImageDataForAsset

Originator:jatinarora269
Number:rdar://21180956 Date Originated:01-06-2015
Status:Unresolved Resolved:
Product: Product Version:
Classification: Reproducible:Always
 
Summary:
This method - (PHImageRequestID)requestImageDataForAsset:(PHAsset *)asset options:(PHImageRequestOptions *)options resultHandler:(void(^)(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info))resultHandler;

does not have a targetSize parameter. This is required when you want the size of the smaller version (2K X 2K) of an image with dimensions let's say 5K X 5K.  In these cases the only option to get the data is by first calling 

- (PHImageRequestID)requestImageForAsset:(PHAsset *)asset targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode options:(PHImageRequestOptions *)options resultHandler:(void (^)(UIImage *result, NSDictionary *info))resultHandler;

 and then calling UIImageJPEGRepresentation.

Steps to Reproduce:
1. Request data for a specified size of an asset using - (PHImageRequestID)requestImageDataForAsset:(PHAsset *)asset options:(PHImageRequestOptions *)options resultHandler:(void(^)(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info))resultHandler
2. Find there is no targetSize parameter.

Expected Results:
Expecting a target size parameter when retrieving data for PHAsset.

Actual Results:
No target size parameter.

Version:
iOS 8.3

Notes:


Configuration:
iPhone 5S, 16 GB, Wifi

Comments

This seems not a bug to me. Rather an API request.

By dinesh.ku at Jan. 9, 2018, 7:39 a.m. (reply...)

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!