New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-k-imagecropper

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-k-imagecropper

Cordova plugin for Image Cropping with custom aspect ratio

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Cordova Image Cropper

Cordova plugin for image cropping with custom aspect ratio.

Platform Support

  • android
  • iOS

Usage

How to add plugin

Type following command from CLI to add this plugin

cordova plugin add cordova-plugin-k-imagecropper

The plugin creates the object window.plugins.k.imagecropper.

Methods

  • open
  • getImageDimension

Example: open

    var options = {
        url: imageUrl,              // required.
        ratio: "6/4",               // required. (here you can define your custom ration) "1/1" for square images
        title: "Custom title",      // optional. android only. (here you can put title of image cropper activity) default: Image Cropper
        autoZoomEnabled: false      // optional. android only. for iOS its always true (if it is true then cropper will automatically adjust the view) default: true
    }
    window.plugins.k.imagecropper.open(options, function(data) {
        // its return an object with the cropped image cached url, cropped width & height, you need to manually delete the image from the application cache.
        console.log(data);          
        $scope.croppedImage = data;
    }, function(error) {
        console.log(error);
    })

Example: getImageDimension

    var imagesArr = [
        "file:///data/user/0/com.ionicframework.creativesdk/cache/tmp_IMG_20170123_0857001689046463.jpg",
        "file:///data/user/0/com.ionicframework.creativesdk/cache/tmp_IMG_20170123_0855131930060303.jpg",
        "file:///data/user/0/com.ionicframework.creativesdk/cache/tmp_IMG-20170123-WA0004-768394128.jpg",
        "file:///data/user/0/com.ionicframework.creativesdk/cache/tmp_IMG_20170123_0856091088191830.jpg",
        "file:///data/user/0/com.ionicframework.creativesdk/cache/tmp_IMG_20170123_085513-1271654176.jpg"
    ];
    window.plugins.k.imagecropper.getImageDimension(imagesArr, function(data) {
        // its return an array of object with the image url, width & height
        console.log(data);          
        $scope.croppedImage = data;
    }, function(error) {
        console.log(error);
    })

Keywords

FAQs

Package last updated on 06 Feb 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc