JoschkaSchulz / cordova-plugin-image-resizer

MIT License
68 stars 113 forks source link

ATTENTION

I don't have any time to maintain this plugin anymore. As long as no one wants to maintain it I don't see the possiblity to fix all the stuff mentioned in the issues, sorry. I recommend to not use this plugin anymore.

Image Resizer for Cordova

By: Protonet GmbH

Authors: Joschka Schulz

Adding the Plugin

Use the Cordova CLI and type in the following command:


// This plugin uses the cordova-plugin-camera
cordova plugin add cordova-plugin-camera

// This plugin
cordova plugin add https://github.com/protonet/cordova-plugin-image-resizer.git

Sample Code

At the moment the plugin is available on android, iOS and windows

resize

window.ImageResizer.resize(options, success, failed);

Options

Android Example

    var options = {
          uri: uri,
          folderName: "Protonet Messenger",
          quality: 90,
          width: 1280,
          height: 1280,
          base64: true,
          fit: false
    };

    window.ImageResizer.resize(options,
      function(image) {
         // success: image is the new resized image
      }, function() {
        // failed: grumpy cat likes this function
      });