Respect scale in RCTPhotoLibraryImageLoader

Summary:
RCTPhotoLibraryImageLoader was not using the scale argument so the image loaded wasn't always the right resolution.

**Test plan**

On my iPhone 6, which has `RCTScreenScale() === 2`, see that an `<Image>` rendered with a `ph://XXX` URI is rendered properly in 2x.

More thoroughly, I used `PHAsset.fetchAssetsWithMediaType(.Image, options: fetchOptions)` to fetch PHAssets to get a `asset.localIdentifier` to test. Then, I rendered a `<Image source={{uri: `ph://${localIdentifier}`}} style={{width: 375, height: 375}} />`.
Closes https://github.com/facebook/react-native/pull/8458

Differential Revision: D3492495

fbshipit-source-id: 34b2757f880edf6ff1751773f6e1a0f62c289f5a
This commit is contained in:
Paul Shen 2016-06-28 00:29:13 -07:00 committed by Facebook Github Bot 9
parent 76f8f42615
commit 9a8fb9c45b
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ RCT_EXPORT_MODULE()
targetSize = PHImageManagerMaximumSize;
imageOptions.resizeMode = PHImageRequestOptionsResizeModeNone;
} else {
targetSize = size;
targetSize = CGSizeApplyAffineTransform(size, CGAffineTransformMakeScale(scale, scale));
imageOptions.resizeMode = PHImageRequestOptionsResizeModeFast;
}