updated getPictures to validate the outputType and default it to FILE_URI when not passed in.

This commit is contained in:
Robert Abeyta
2015-05-18 13:28:07 -07:00
parent 2bc95161ac
commit ca844db4ec
+7 -2
View File
@@ -35,19 +35,24 @@ ImagePicker.prototype.validateOutputType = function(options){
* image will be returned)
* .height - height to resize image to
* .quality - quality of resized image, defaults to 100
* .outputType - type of output returned. defaults to file URIs.
* Please see ImagePicker.OutputType for available values.
*/
ImagePicker.prototype.getPictures = function(success, fail, options) {
if (!options) {
options = {};
}
this.validateOutputType(options);
var params = {
maximumImagesCount: options.maximumImagesCount ? options.maximumImagesCount : 15,
width: options.width ? options.width : 0,
height: options.height ? options.height : 0,
quality: options.quality ? options.quality : 100
quality: options.quality ? options.quality : 100,
outputType: options.outputType ? options.outputType : this.OutputType.FILE_URI
};
return cordova.exec(success, fail, "ImagePicker", "getPictures", [params]);
};