gif-cropper
v1.0.1
Published
Crop GIF images using Javascript.
Downloads
41
Readme
GIF Cropper
Crop GIF images using Javascript.
Features
- [x] Support for GIF cropping.
- [x] Support for collaboration with cropperjs.
- [x] Support for PNG / JPG /JPEG cropping.
Demo
Preview
GIF
Static Image
Getting started
Installation
npm i gif-cropper
Usage
import { GIFCropper } from 'gif-cropper';
const imageCropper = new GIFCropper({
src: gifUrl,
cropperJsOpts: {
width: 400,
height: 240,
rotate: 45,
y: 0,
x: 0,
}
});
imageCropper.crop().then(blobUrl => {
const img = document.createElement('img');
img.src = blobUrl;
document.body.appendChild(img);
});
Working With CropperJs
import { GIFCropper, CustomCropper } from 'gif-cropper';
const imageCropper = new GIFCropper({
cropperInstance: cropperInstance as CustomCropper,
src: gifUrl
});
imageCropper.crop().then(blobUrl => {
const img = document.createElement('img');
img.src = blobUrl;
document.body.appendChild(img);
});