cordova-plugin-scanbot-image-picker
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Scanbot Image Picker for Cordova

Simple plugin that implements a very straight-forward native iOS & Android Image Picker, which features:

  • Multiple Images Selection

  • Customizable Parameters

  • Typescript definitions

  • Promisified API interface

Installation

cordova plugin add cordova-plugin-scanbot-image-picker

Usage

Import Module

import ScanbotImagePicker from 'cordova-plugin-scanbot-image-picker'

Pick Single Image

Opens the native single image picker, and returns the selected image file URI.

Example

const result = await ScanbotImagePicker.pickImage();

if (result.status == "OK") {
    let image = result.imageFileUri;
}

Optional Parameters

export interface ScanbotImagePickerSingleConfiguration {
    /**
    * The quality of the images returned by the Image Picker, from 0 to 100 (default = 100)
    */
    imageQuality?:  number;
}

Result

export interface ScanbotImagePickerSingleResult {
    status: "OK"  |  "CANCELED";
    imageFileUri?:  string;
}

Pick Multiple Images

Opens the multiple image picker, and returns the selected image files URIs.

Example

const result = await ScanbotImagePicker.pickImages();

if (result.status  ==  "OK") {
    let images = result.imageFilesUris;
}

Optional Parameters

export interface ScanbotImagePickerMultipleConfiguration {
    /**
    * Maximum selectable images. Default is 0 (unlimited).
    */
    maxImages?:  number;
    /**
    * The quality of the images returned by the Image Picker, from 0 to 100 (default = 100).
    */
    imageQuality?:  number;
}

Result

export interface ScanbotImagePickerMultipleResult {
    status: "OK"  |  "CANCELED";
    imageFilesUris: string[];
}

Contributing

Contributions in the form of issues, pull requests and suggestions are very welcome.

Disclaimer

This package is still in beta and should be used with that in mind.

License

MIT

Package Sidebar

Install

npm i cordova-plugin-scanbot-image-picker

Homepage

scanbot.io

Weekly Downloads

4

Version

1.1.0

License

MIT

Unpacked Size

367 kB

Total Files

40

Last publish

Collaborators

  • scanbot