Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kkristof200/jimpautocrop
https://github.com/kkristof200/jimpautocrop
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kkristof200/jimpautocrop
- Owner: kkristof200
- License: mit
- Created: 2020-09-27T09:04:53.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-27T09:35:05.000Z (about 4 years ago)
- Last Synced: 2024-04-25T18:42:53.178Z (7 months ago)
- Language: TypeScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jimp-autocrop
auto crop centre of a jimp image based on min and max ratio (width/height)
## Install
```bash
npm i jimp-autocrop
```## Usage
```typescript
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))
```