-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
console.error: "Image source size {28.666666666666668, 25} does not match loaded image size {28, 25}." #5586
Comments
Hey jasonmerino, thanks for reporting this issue! React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
|
I got this error too but only after upgrading to xcode 7.2.1 |
So I just got a message from the designer I work with that he has resolved this issue. May have been the way the image was saved initially. Who knows. Going to leave this open, but as of now, this issue has been resolved on our side. |
I have the same issue. Commenting out the section in RCTConvert.m is a workaround for me at the moment: https://github.com/facebook/react-native/blob/master/React/Base/RCTConvert.m#L914-L918 but obviously that is not a suitable fix and it may have side effects. |
anyone fixed that problem? I met the same problem. |
why this error occured? i got this error in debug but not in release. it's very werid |
@facebook-github-bot bugfix |
@facebook-github-bot label Help Wanted |
Hey @jasonmerino, we're a small team and rely on the community to fix issues that don't affect fb apps. If you're sure this is a bug can you send a pull request with a fix? |
I've got the same error message and found out this is because my 3x.png image are not exactly thrice the point size. |
Same error for me, only able to get it to work by having exactly 3* and 2* multiples of image sizes. |
Same issue. What solved it for me is having a 3x image that doesn't create a 1x image that has decimals other than .0 or .5 otheriwse RCTConvert will do its math and fail because the actual image does have the decimals in its width or height. It's actually fairly easy: just make sure your 3x image has sides that can be divided by 2 and 3 without causing issues. |
The same using NavigatorIOS->initalRoute->titleImage. I've just got image from xcode resources and past it to react native project, made reference to the image. And it doesn't display it :( Why it's not automatically resized or why this error is ever shown? |
I found this solution. |
The sizes need to match and be perfect multiplications in their 2x and 3x
forms. If you have img at 20*20 make sure that your 2@ and 3@ are exact
multiplications. If not rn will complain. It might be any one image in the
triplet... not necessarily the 1x
Op wo 17 mei 2017 om 21:21 schreef Ann Catton <notifications@github.com>
… I've been getting this issue with the thumbImage for a Slider, but all my
images are sized with matching ratios: 1x(40x40), 2x(80x80) and
3x(120x120). But my error says the loaded image size is {0,0} so I'm not
sure if it's the same as the above issues?
[image: handleslidererror]
<https://cloud.githubusercontent.com/assets/5624601/26171342/9bfcdf4c-3b12-11e7-8e20-21c2305de2e1.png>
Anyone else experienced this? It's happened in RN 0.39 and RN 0.44, but
occurs only intermittently.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5586 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAqbukCiH45hjd83J9SjpQ_Q-Lz32njdks5r60jGgaJpZM4HN5Zp>
.
|
The error complains about the 2x image, although the size it gives is the 1x dimensions. All 3 are definitely exact multiples - 40, 80 and 120. |
This comment has been minimized.
This comment has been minimized.
I had same issue. to resolveRemove the original image asset that has filename without
You must remove If you only have:
Then you can just keep that alone (with no |
@anncatton Have you solved this error ? It occurs only intermittently,too ,My react-native version is 0.49.3 |
@hramos I still see this issue in React Native 0.55.4. Can we reopen the issue? |
Looks like https://github.com/facebook/react-native/blob/master/React/Base/RCTConvert.m#L764-L768 Why are we running all images through If I understand this method correctly, images from |
@anncatton how did you managed to solve the issue which is giving {0,0} size of loaded image? |
@amit2908 I never did find a solution for this issue, but I haven't had time to look at it recently. |
@getaaron I'm running into this a bunch right now. Any idea how to resolve this? Have you? |
You can resolve this by making sure your 2x and 3x images are exact multiples of the 1x image size. |
@hramos thanks. I will make sure to do that. |
@hramos I don’t think that fixes the part of the issue where some images load as 0,0 sized images |
Following this, does anybody has steps to reproduce? |
@anncatton , are you using custom root with the metro bundler? |
The solution to the issue reported by the OP is that the 1x, 2x, and 3x images must be exact multiples of the 1x image. It seems like the 0,0 sized image error is a separate problem. I'm going to close this as it seems like the original issue is resolved, but feel free to create a new issue for the 0,0 problem. |
@MrPluto We are also facing the same issue in debug mode. |
I'm getting this error when loading up the main view of the app I'm working on. I've tracked it down to one of the icon images in the tab bar. The dimensions of the image it's trying to load up is 56px x 50px. The funny thing is that it seems to only be happening on the @2x version of the image. The @3x image doesn't show this issue.
I've tried updating the image and resaving it to the exact size of 56 x 50 to no avail. Not sure if this is an issue with React Native, but figured I'd put it up here since the issue just popped up a couple versions ago when I upgraded the version of React Native.
The text was updated successfully, but these errors were encountered: