From b758d63bc9fb4180ebab4b81f08c54a9741d0e84 Mon Sep 17 00:00:00 2001 From: ericlewis Date: Mon, 25 Feb 2019 11:25:32 -0800 Subject: [PATCH] Fix image scaling (#23641) Summary: An updated version of: #22009, this compares the correct image size. [iOS] [Fixed] - Compare network image sizes correctly Pull Request resolved: https://github.com/facebook/react-native/pull/23641 Differential Revision: D14210991 Pulled By: hramos fbshipit-source-id: 079053ef4a8f0e62da6eead9afc8de9285b35966 --- Libraries/Image/RCTImageView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/Image/RCTImageView.m b/Libraries/Image/RCTImageView.m index 3392a54c5..3b3d0ea70 100644 --- a/Libraries/Image/RCTImageView.m +++ b/Libraries/Image/RCTImageView.m @@ -412,8 +412,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) return; } - // Don't reload if the current image size is the maximum size of the image source - CGSize imageSourceSize = _imageSource.size; + // Don't reload if the current image size is the maximum size of either the pending image source or image source + CGSize imageSourceSize = (_imageSource ? _imageSource : _pendingImageSource).size; if (imageSize.width * imageScale == imageSourceSize.width * _imageSource.scale && imageSize.height * imageScale == imageSourceSize.height * _imageSource.scale) { return;