From a173570688b2ce5e64be5dd8b3f80ced7d911422 Mon Sep 17 00:00:00 2001 From: Robert Abeyta Date: Mon, 18 May 2015 13:24:39 -0700 Subject: [PATCH] updated readme with output type example --- README.md | 68 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 440e3ab..37f18e0 100644 --- a/README.md +++ b/README.md @@ -20,29 +20,29 @@ The plugin creates the object `window.imagePicker` with the method `getPictures( Example - Get Full Size Images (all default options): ```javascript window.imagePicker.getPictures( - function(results) { - for (var i = 0; i < results.length; i++) { - console.log('Image URI: ' + results[i]); - } - }, function (error) { - console.log('Error: ' + error); - } + function(results) { + for (var i = 0; i < results.length; i++) { + console.log('Image URI: ' + results[i]); + } + }, function (error) { + console.log('Error: ' + error); + } ); ``` Example - Get at most 10 images scaled to width of 800: ```javascript window.imagePicker.getPictures( - function(results) { - for (var i = 0; i < results.length; i++) { - console.log('Image URI: ' + results[i]); - } - }, function (error) { - console.log('Error: ' + error); - }, { - maximumImagesCount: 10, - width: 800 - } + function(results) { + for (var i = 0; i < results.length; i++) { + console.log('Image URI: ' + results[i]); + } + }, function (error) { + console.log('Error: ' + error); + }, { + maximumImagesCount: 10, + width: 800 + } ); ``` @@ -50,24 +50,30 @@ window.imagePicker.getPictures( options = { // max images to be selected, defaults to 15. If this is set to 1, upon - // selection of a single image, the plugin will return it. - maximumImagesCount: int, - - // max width and height to allow the images to be. Will keep aspect - // ratio no matter what. So if both are 800, the returned image - // will be at most 800 pixels wide and 800 pixels tall. If the width is - // 800 and height 0 the image will be 800 pixels wide if the source - // is at least that wide. - width: int, - height: int, - - // quality of resized image, defaults to 100 - quality: int (0-100) + // selection of a single image, the plugin will return it. + maximumImagesCount: int, + + // max width and height to allow the images to be. Will keep aspect + // ratio no matter what. So if both are 800, the returned image + // will be at most 800 pixels wide and 800 pixels tall. If the width is + // 800 and height 0 the image will be 800 pixels wide if the source + // is at least that wide. + width: int, + height: int, + + // quality of resized image, defaults to 100 + quality: int (0-100), + + // output type, defaults to FILE_URIs. + // available options are + // window.imagePicker.OutputType.FILE_URI (0) or + // window.imagePicker.OutputType.BASE64_STRING (1) + outputType: int }; ### Note for Android Use -The plugin returns images that are stored in a temporary directory. These images will often not be deleted automatically though. The files should be moved or deleted after you get their filepaths in javascript. +When outputType is FILE_URI the plugin returns images that are stored in a temporary directory. These images will often not be deleted automatically though. The files should be moved or deleted after you get their filepaths in javascript. If Base64 Strings are being returned, there is nothing to clean up. ## Libraries used