ImageResizer

Improve this doc

$ ionic plugin add https://github.com/protonet/cordova-plugin-image-resizer.git

Repo: https://github.com/protonet/cordova-plugin-image-resizer

Cordova Plugin For Image Resize

Requires plugin info.protonet.imageresizer - use the Ionic CLI and type in the following command: ionic plugin add https://github.com/protonet/cordova-plugin-image-resizer.git

For more info, please see the https://github.com/protonet/cordova-plugin-image-resizer

Usage

import { ImageResizer, ImageResizerOptions } from 'ionic-native';

let options = {
 uri: uri,
 folderName: 'Protonet',
 quality: 90,
 width: 1280,
 height: 1280
} as ImageResizerOptions;

ImageResizer
.resize(options)
.then(
 (filePath: string) => { console.log('FilePath', filePath); },
 () => { console.log('Error occured'); }
)

Static Members

resize()

Returns: Promise<any>

ImageResizerOptions

Param Type Details
uri string

The URI for the image on the device to get scaled

width number

The width of the new image

height number

The height of the new image

folderName
(optional)
string

The name of the folder the image should be put (Android only)

quality
(optional)
number

Quality given as Number for the quality of the new image (Android and iOS only)

fileName
(optional)
string

A custom name for the file. Default name is a timestamp (Android and Windows only)

API

Native

General