# gulp-autocrop

> Based on https://github.com/odrick/gulp-images-resizer so all credit to odrick, however I didn't want to rewrite his library to conform to latest jimp so made my own.

Latest version **0.0.6** (published 2019-09-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install gulp-autocrop
pnpm add gulp-autocrop
yarn add gulp-autocrop
bun add gulp-autocrop
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2019-09-20 |
| First published | 2019-07-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Michael K. Markie |
| Maintainers | michael.markie |
| Keywords | gulp, gulp-autocrop, crop, quick crop, auto crop, ratio crop, aspect ratio |

## Links

- npm: https://www.npmjs.com/package/gulp-autocrop
- Repository: https://gitlab.com/michaelmarkie/gulp-autocrop
- Homepage: https://gitlab.com/michaelmarkie/gulp-autocrop#readme
- Issues: https://gitlab.com/michaelmarkie/gulp-autocrop/issues
- npm.io page: https://npm.io/package/gulp-autocrop

## Dependencies (2)

- [jimp](https://npm.io/package/jimp.md) ^0.6.4
- [through2](https://npm.io/package/through2.md) ^3.0.1

## Recent versions

- 0.0.6 (latest) — 2019-09-20
- 0.0.5 — 2019-09-19
- 0.0.4 — 2019-07-25
- 0.0.3 — 2019-07-25
- 0.0.2 — 2019-07-24
- 0.0.1 — 2019-07-24

## README

# gulp-autocrop

Based on https://github.com/odrick/gulp-images-resizer so all credit to odrick, however I didn't want to rewrite his library to conform to latest jimp so made my own.

It will only resize and crop your image any quality adjustments need to be done in another gulp plugin such as imagemin.


### Install
```bash
npm install gulp-autocrop
```

### Usage
```js
const { src, dest } = require('gulp');
const autocrop = require('gulp-autocrop');


function imageTask (cb) {
    src('src/*.png')
        .pipe(autocrop({
            ratio: '16:9'
        }))
        .pipe(dest('output'))
        .on('finish', cb);
};

exports.default = imageTask;
```

### Options

Must have at least one of the following options:

* `ratio` - `string` 16:9, 2:1 whatever you fancy.
* `width` - `int` in pixels only.
* `height` - `int` in pixels only.
* `maintainAspectRatio` - `boolean` default true maintain structure of the image if height or width is auto

---
_Source: https://npm.io/package/gulp-autocrop · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
