mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 21:53:30 +00:00
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:
parent
76f8f42615
commit
9a8fb9c45b
@ -66,7 +66,7 @@ RCT_EXPORT_MODULE()
|
|||||||
targetSize = PHImageManagerMaximumSize;
|
targetSize = PHImageManagerMaximumSize;
|
||||||
imageOptions.resizeMode = PHImageRequestOptionsResizeModeNone;
|
imageOptions.resizeMode = PHImageRequestOptionsResizeModeNone;
|
||||||
} else {
|
} else {
|
||||||
targetSize = size;
|
targetSize = CGSizeApplyAffineTransform(size, CGAffineTransformMakeScale(scale, scale));
|
||||||
imageOptions.resizeMode = PHImageRequestOptionsResizeModeFast;
|
imageOptions.resizeMode = PHImageRequestOptionsResizeModeFast;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user