Skip to content

Commit

Permalink
Respect scale in RCTPhotoLibraryImageLoader
Browse files Browse the repository at this point in the history
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 #8458

Differential Revision: D3492495

fbshipit-source-id: 34b2757f880edf6ff1751773f6e1a0f62c289f5a
  • Loading branch information
paulshen authored and Facebook Github Bot 9 committed Jun 28, 2016
1 parent 76f8f42 commit 9a8fb9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/CameraRoll/RCTPhotoLibraryImageLoader.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ - (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL
targetSize = PHImageManagerMaximumSize;
imageOptions.resizeMode = PHImageRequestOptionsResizeModeNone;
} else {
targetSize = size;
targetSize = CGSizeApplyAffineTransform(size, CGAffineTransformMakeScale(scale, scale));
imageOptions.resizeMode = PHImageRequestOptionsResizeModeFast;
}

Expand Down

0 comments on commit 9a8fb9c

Please sign in to comment.