0.1.0 • Published 4 years ago

jimp-autocrop v0.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

jimp-autocrop

auto crop centre of a jimp image based on min and max ratio (width/height)

Install

npm i jimp-autocrop

Usage

import Jimp from 'jimp'
import { cropCentreFromPath } from 'jimp-autopcrop'

cropCentreFromPath('inPath', { outImgPath: 'outPath', ratio: { min: 0.75, max: 1.25 })
.then(res => {
    console.log(res.img, res.path)
})
.catch(err => console.log(err))