react-native-local-image-manager

1.0.1 • Public • Published

react-native-local-image-manager

A React Native module for downloading and resizing images natively.

Add it to your project

  1. Run npm install react-native-local-image-manager --save
  2. Add RCTLocalImageManager.m to your Xcode project.

Usage

var { NativeModules } = require('react-native');
var LocalImageManager = require('NativeModules').LocalImageManager;
 
// Resize a local image
var options = {
    uri: '<LOCAL FILE PATH>',
    width: 100,
    height: 100,
    quality: 0.5,
    filename: 'myfile.jpg',
};
 
LocalImageManager.resize(options, function (results) {
    // results is the filesystem path of the resized image
    console.log(results);
});
 
 
 
// Remove the resized local image
LocalImageManager.remove('<LOCAL FILE PATH>');
 
 
 
// Download an image and store it locally
var options = {
    uri: 'https://www.google.com/images/srpr/logo11w.png',
    filename: 'google_logo.png',
};
 
LocalImageManager.download(options, function (results) {
    // results is the filesystem path of the downloaded image
    console.log(results);
});

Readme

Keywords

none

Package Sidebar

Install

npm i react-native-local-image-manager

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • asa