{"_id":"cordova-plugin-crop-figb","_rev":"52-048d3caefc4a2da6d14de63c53d6b386","name":"cordova-plugin-crop-figb","description":"This is just cordova-plugin-crop v0.4.0 with few changes.","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"cordova-plugin-crop-figb","version":"1.0.0","description":"This is just cordova-plugin-crop v0.4.0 with few changes.","cordova":{"id":"cordova-plugin-crop-figb","platforms":["android","ios"]},"keywords":["cordova","ecosystem:cordova","cordova-android","cordova-ios","image","image manipulation","crop"],"license":"MIT","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"FIGB"},"main":"index.js","_id":"cordova-plugin-crop-figb@1.0.0","_shasum":"f6a1c3aab3a902c5f0fd575912daba0ae4d66613","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"figb","email":"info@federbridge.it"},"dist":{"shasum":"f6a1c3aab3a902c5f0fd575912daba0ae4d66613","tarball":"https://registry.npmjs.org/cordova-plugin-crop-figb/-/cordova-plugin-crop-figb-1.0.0.tgz","integrity":"sha512-ai/dNkOCJJ7C+8Lqr2Gk2/YG5pKbKvZhisbU0jFl0TAAbJpJK5c9j73WgMUkfT7xxh0ftxjP6CByRKvaAST6rg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHQ+3f6VTk6jXF5ZSfTlnlwJ21wo5anjki/QB3Z5GrXTAiEAhGLDW5F34Kq7VVjqsI2Riacjng6yD4C68qq/g/VBbMA="}]},"maintainers":[{"name":"figb","email":"info@federbridge.it"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cordova-plugin-crop-figb-1.0.0.tgz_1501079472957_0.13113641156814992"}}},"readme":"# cordova-plugin-crop\n\n> This is just cordova-plugin-crop v0.4.0 with few changes\n\n\n## Install\n\n```\n$ cordova plugin add --save cordova-plugin-crop-figb\n```\n\n\n## Usage\n\n```js\nplugins.crop(function success () {\n\n}, function fail () {\n\n}, '/path/to/image', options)\n```\n\nor, if you are running on an environment that supports Promises\n(Crosswalk, Android >= KitKat, iOS >= 8)\n\n```js\nplugins.crop.promise('/path/to/image', options)\n.then(function success (newPath) {\n\n})\n.catch(function fail (err) {\n\n})\n```\n\n## API\n\n * quality: Number\n\nThe resulting JPEG quality. default: 100\n\n## Ionic / Typescript Example Angular 2 Service\n\n<img src=\"screenshot-example.png\" width=\"250\" height=\"500\">\n\nThis is an example service that uses ionic-native's built in camera and the cordova-plugin-crop to create a cropped version of the image and return the file path. \n\n```js\nimport { Injectable } from '@angular/core';\nimport { Platform } from 'ionic-angular';\nimport { Camera, Crop } from 'ionic-native';\n\n@Injectable()\nexport class CameraService {\n\n  public options: any = {\n        allowEdit: true,\n        sourceType: Camera.PictureSourceType.SAVEDPHOTOALBUM,\n        mediaType: Camera.MediaType.ALLMEDIA,\n        destinationType: Camera.DestinationType.FILE_URI\n  }\n  \n  constructor(public platform: Platform) {}\n\n  // Return a promise to catch errors while loading image\n  getMedia(): Promise<any> {\n    // Get Image from ionic-native's built in camera plugin\n    return Camera.getPicture(this.options)\n      .then((fileUri) => {\n        // Crop Image, on android this returns something like, '/storage/emulated/0/Android/...'\n        // Only giving an android example as ionic-native camera has built in cropping ability\n        if (this.platform.is('ios')) {\n          return fileUri\n        } else if (this.platform.is('android')) {\n          // Modify fileUri format, may not always be necessary\n          fileUri = 'file://' + fileUri;\n\n          /* Using cordova-plugin-crop starts here */\n          return Crop.crop(fileUri, { quality: 100 });\n        }\n      })\n      .then((path) => {\n        // path looks like 'file:///storage/emulated/0/Android/data/com.foo.bar/cache/1477008080626-cropped-figb.jpg?1477008106566'\n        console.log('Cropped Image Path!: ' + path);\n        return path;\n      })\n  }\n  \n}  \n```\n\n\n\n### Libraries used\n\n * iOS: [PEPhotoCropEditor](https://github.com/kishikawakatsumi/PEPhotoCropEditor)\n * Android: [android-crop](https://github.com/jdamcd/android-crop)\n\n## License\n\nMIT © [Jeduan Cornejo](https://github.com/jeduan)\n","maintainers":[{"name":"figb","email":"info@federbridge.it"}],"time":{"modified":"2022-06-14T00:02:16.436Z","created":"2017-07-25T15:43:29.464Z","0.4.0":"2017-07-25T15:43:29.464Z","0.0.1":"2017-07-25T16:16:20.979Z","0.0.2":"2017-07-26T07:26:02.763Z","0.0.3":"2017-07-26T07:51:41.122Z","0.0.4":"2017-07-26T08:14:20.759Z","0.0.5":"2017-07-26T08:45:37.345Z","0.0.6":"2017-07-26T08:49:03.490Z","0.0.7":"2017-07-26T09:09:22.959Z","0.0.8":"2017-07-26T09:20:50.199Z","0.0.9":"2017-07-26T09:27:24.071Z","0.0.10":"2017-07-26T09:34:57.689Z","0.0.11":"2017-07-26T09:56:45.132Z","0.0.12":"2017-07-26T10:05:48.563Z","0.0.13":"2017-07-26T10:12:06.343Z","0.0.14":"2017-07-26T10:36:11.900Z","0.0.15":"2017-07-26T10:40:11.967Z","0.0.16":"2017-07-26T10:59:33.327Z","0.0.17":"2017-07-26T12:16:20.492Z","0.0.18":"2017-07-26T12:41:41.965Z","0.0.19":"2017-07-26T13:01:54.979Z","0.0.20":"2017-07-26T13:30:54.029Z","0.0.21":"2017-07-26T13:40:41.275Z","0.0.22":"2017-07-26T13:46:13.149Z","0.0.23":"2017-07-26T13:58:37.215Z","0.0.24":"2017-07-26T14:11:52.396Z","1.0.0":"2017-07-26T14:31:14.572Z"},"keywords":["cordova","ecosystem:cordova","cordova-android","cordova-ios","image","image manipulation","crop"],"license":"MIT","readmeFilename":"README.md","author":{"name":"FIGB"}}