1.1.0 • Published 6 years ago

image-ghost-canvas v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

image-ghost-canvas

image-ghost-canvas is a tool for image you want to trimming cut on Browser. for example if you want to cut with keeping the image's aspect ratio, I recommend this tool for that.

Demo

Plunker

Usage

import ImageGhostCanvas from 'image-ghost-canvas';
public imageGhostCanvas = new ImageGhostCanvas(option);

option \

  • size \ Size for trimming image size.

Resize image

imageGhostCanvas.resizeImage(data);

data \<data URI> you can git encoded image data that its type jpeg or ping.

Return: \

Example

// success
imageGhostCanvas.resizeImage(imageData)
.then((data) => {
    imageSrc = data;
});

// error
imageGhostCanvas.resizeImage(imageData)
.catch((error) => {
    // when it result error, do something for error.
});