
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-native-webp-format
Advanced tools
By utilizing WebP instead of png/jpg you can significantly reduce the size of your app without quality loss.
Works with both Image and ImageBackground React Native components.
iOS uses SDWebImage implementation and Android utilizes Fresco to boost the gained performance even more.
Here's a detailed article with extra information on what is the best way to convert your regular images to WebP.
0.61 or higher (last tested on 0.78.0). Older versions might work too, but that's not guaranteed.yarn add react-native-webp-format
npm i react-native-webp-format
cd ios && pod install
Add the following dependencies to android/app/build.gradle:
dependencies {
...
implementation 'com.facebook.fresco:webpsupport:3.2.0'
// Optionally, to display animated WebP images, you have to add:
implementation 'com.facebook.fresco:animated-webp:3.2.0'
...
}
Check the example app if you have any issues. Remember to restart your packager to see the changes. If you still have any issues, try resetting the cache.
Simply replace .png or .jpg with .webp after you've converted your files <Image source={require('../../assets/close.webp')} />
.getSize() doesn't work on WebP images. Use instead:
const {width, height} = Image.resolveAssetSource(require('./assets/1.sm.webp'));
PRs are welcomed ❤️
FAQs
WebP integration for React Native apps
We found that react-native-webp-format 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.