Image Picker

Improve this doc

$ ionic plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker
$ npm install --save @ionic-native/image-picker

Repo: https://github.com/Telerik-Verified-Plugins/ImagePicker

Cordova Plugin For Multiple Image Selection

Requires Cordova plugin: cordova-plugin-image-picker. For more info, please see the https://github.com/wymsee/cordova-imagePicker

Supported platforms

Usage

import { ImagePicker } from '@ionic-native/image-picker';


constructor(private imagePicker: ImagePicker) { }

...

this.imagePicker.getPictures(options).then((results) => {
  for (var i = 0; i < results.length; i++) {
      console.log('Image URI: ' + results[i]);
  }
}, (err) => { });

Instance Members

getPictures(options)

Pick pictures from the library.

Param Type Details
options ImagePickerOptions

Returns: Promise<any> Returns a Promise that resolves the image file URI otherwise rejects with an error.

hasReadPermission()

Platforms:Android 

Check if we have permission to read images

Returns: Promise<boolean> Returns a promise that resolves with a boolean that indicates whether we have permission

requestReadPermission()

Platforms:Android 

Request permission to read images

Returns: Promise<any>

ImagePickerOptions

Param Type Details
maximumImagesCount number

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.

(optional)
width number

Max width to allow images to be

(optional)
height number

Max height to allow images to be

(optional)
quality number

Quality of images, defaults to 100

(optional)
outputType number

Output type, defaults to 0 (FILE_URI).

(optional)

API

Native

General