From 9a8fb9c45b018312da0ad47f35686b911ebb8693 Mon Sep 17 00:00:00 2001 From: Paul Shen Date: Tue, 28 Jun 2016 00:29:13 -0700 Subject: [PATCH] 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 `` 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 ``. Closes https://github.com/facebook/react-native/pull/8458 Differential Revision: D3492495 fbshipit-source-id: 34b2757f880edf6ff1751773f6e1a0f62c289f5a --- Libraries/CameraRoll/RCTPhotoLibraryImageLoader.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/CameraRoll/RCTPhotoLibraryImageLoader.m b/Libraries/CameraRoll/RCTPhotoLibraryImageLoader.m index 3cb4d1c3b..f1ccc4996 100644 --- a/Libraries/CameraRoll/RCTPhotoLibraryImageLoader.m +++ b/Libraries/CameraRoll/RCTPhotoLibraryImageLoader.m @@ -66,7 +66,7 @@ RCT_EXPORT_MODULE() targetSize = PHImageManagerMaximumSize; imageOptions.resizeMode = PHImageRequestOptionsResizeModeNone; } else { - targetSize = size; + targetSize = CGSizeApplyAffineTransform(size, CGAffineTransformMakeScale(scale, scale)); imageOptions.resizeMode = PHImageRequestOptionsResizeModeFast; }