
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-image-size
Advanced tools
Android 4.0 (API level 14) introduced the ability to get original image size.
iOS uses Image.getSize https://facebook.github.io/react-native/docs/image#getsize
Download via NPM
npm i -S react-native-image-size
Download via Yarn
yarn add react-native-image-size
Afterward make sure to rebuild app, not just refresh bundler.
-- Automaticaly --
Link, either via react-native link or manually
react-native link react-native-image-size
-- Manually --
+include ':react-native-image-size'
+project(':react-native-image-size').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-size/android')
dependencies {
...
+ implementation project(':react-native-image-size')
...
}
+import com.existfragger.rnimagesize.RNImageSizePackage;
...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<~>asList(
- new MainReactPackage()
+ new MainReactPackage(),
+ new RNImageSizePackage()
);
}
import ImageSize from 'react-native-image-size'
...
ImageSize.getSize(uri).then(size => {
// size.height
// size.width
})
You can also use async/await, if you would prefer.
import ImageSize from 'react-native-image-size'
...
foo = async () => {
const { width, height } = await ImageSize.getSize(uri);
// do stuff with width and height
}
FAQs
Get original image size (iOS + Android)
We found that react-native-image-size demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.