Skip to content
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

0.14 required image cannot get width/height #4025

Closed
smalllixin opened this issue Nov 10, 2015 · 1 comment
Closed

0.14 required image cannot get width/height #4025

smalllixin opened this issue Nov 10, 2015 · 1 comment
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@smalllixin
Copy link

Firstly, I love new the asset management strategy.

//before 0.14
var img = require('image!xxx');
img.width, img.height 
var img = require('./img/abc.png');
//I see img is compiled index as integer type

So how can I get image width/height?

@smalllixin
Copy link
Author

Find a way to handle this:

// for react native 0.14 +
var resolveAssetSource = require('resolveAssetSource');
var imgSrc = resolveAssetSource(require('./some.png'));
console.log(imgSrc.width, imgSrc.height);

@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants