Socket
Book a DemoInstallSign in
Socket

gif-cropper

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gif-cropper

Crop GIF images using Javascript.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
315
231.58%
Maintainers
1
Weekly downloads
 
Created
Source

GIF Cropper

Crop GIF images using Javascript.

Features

  • Support for GIF cropping.
  • Support for collaboration with cropperjs.
  • Support for PNG / JPG /JPEG cropping.

Demo

Online 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);
});

FAQs

Package last updated on 23 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts