winninggogl.blogg.se

React native image resize
React native image resize













react native image resize

We already received a lot of pull requests fixing bugs or adding new features. If you want your user to be able to take photos, be sure to check react-native-camera! Contributing to react-native-image-resizer The module support both local images and photos from the photo library (as the ones given by CameraRoll API from React Native). ImageUri is the path to the image to be resized. IOS and Android are both supported, and it outputs either png or jpeg files. ++pre>++code>import ImageResizer from 'react-native-image-resizer' ImageResizer.createResizedImage(imageUri, newWidth, newHeight, compressFormat, quality, rotation, outputPath).then((resizedImageUri) => ) ++/code>++/pre>

React native image resize install#

++pre>++code>npm install -save react-native-image-resizer react-native link react-native-image-resizer ++/code>++/pre>

react native image resize

You can use an image from the camera roll or a ++code>base64++/code>encoded image. Give it the path of an image and new dimensions and it will generate a new image with these dimensions. To resize local image files, we created react-native-image-resizer. Installing and using react-native-image-resizer Our package helps you with this situation by allowing image resizing directly from React Native. Whenever your app requires the user to take a picture with the camera, or from the camera roll, the image is so heavy that it takes ages to upload it on the server.















React native image resize