npm i --save nativescript-imageoptimize
- Version: 1.0.0
- GitHub:
- NPM: https://www.npmjs.com/package/nativescript-imageoptimize
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 0
Nativescript ImageOptimize
Installation
tns plugin add nativescript-imageoptimize
Usage
import { ImageOptimize } from 'nativescript-imageoptimize';
import * as fs from 'tns-core-modules/file-system';
const imageoptimize = new ImageOptimize({
src: '~/destiny_2.jpg',
height: 400, //optional
width:400,
quality: 50, // 100 - 1
format:'jpg' // jpeg || jpg || png
dest: fs.knownFolders.documents().getFolder('images').path
})
const ImageOptimize = require('nativescript-imageoptimize').ImageOptimize;
const fs = require('tns-core-modules/file-system');
const imageoptimize = new ImageOptimize({
src: '~/destiny_2.jpg',
height: 400, //optional
width:400,
quality: 50, // 100 - 1
format:'jpg' // jpeg || jpg || png
dest: fs.knownFolders.documents().getFolder('images').path,
})
API
Property | Default | Type | Required | Description |
---|---|---|---|---|
width | source width | number |
|
|
height | source width | number |
|
|
quality | null | number |
|
|
format | jpg | string |
|
|
dest | null | string |
|
|
src | null | string |
|
License
Apache License Version 2.0, January 2004