mirror of
https://gitee.com/shuto/cordova-imagePicker.git
synced 2026-05-23 00:05:03 +08:00
updated getPictures to validate the outputType and default it to FILE_URI when not passed in.
This commit is contained in:
+7
-2
@@ -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]);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user