From eb69d036d5a486fa915121877fa68ebf7d8fef58 Mon Sep 17 00:00:00 2001 From: Li Jie Date: Tue, 31 May 2016 05:18:17 -0700 Subject: [PATCH] Log image url when image size doesn't match. Summary: Sometimes I got error message about image size doesn't match, but I don't know which image is wrong. Before: 2016-05-31 11 03 58 After this PR: 2016-05-31 10 59 21 **Test plan (required)** ``` ``` And don't add this image into project, it would report errors when run it. Closes https://github.com/facebook/react-native/pull/7840 Differential Revision: D3365467 Pulled By: nicklockwood fbshipit-source-id: de3d5989ef0a3c443cce557901486c4770d4e906 --- React/Base/RCTConvert.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/React/Base/RCTConvert.m b/React/Base/RCTConvert.m index ebdbee02a..f5c6924d6 100644 --- a/React/Base/RCTConvert.m +++ b/React/Base/RCTConvert.m @@ -913,8 +913,10 @@ RCT_ENUM_CONVERTER(RCTAnimationType, (@{ if (!CGSizeEqualToSize(imageSource.size, CGSizeZero) && !CGSizeEqualToSize(imageSource.size, image.size)) { - RCTLogError(@"Image source size %@ does not match loaded image size %@.", - NSStringFromCGSize(imageSource.size), NSStringFromCGSize(image.size)); + RCTLogError(@"Image source %@ size %@ does not match loaded image size %@.", + imageSource.imageURL.path.lastPathComponent, + NSStringFromCGSize(imageSource.size), + NSStringFromCGSize(image.size)); } return image;