# grunt-image-autoresize

> Auto-resize images larger than a certain size

Latest version **0.0.5** (published 2017-11-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install grunt-image-autoresize
pnpm add grunt-image-autoresize
yarn add grunt-image-autoresize
bun add grunt-image-autoresize
```

## 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.5 |
| Published | 2017-11-10 |
| First published | 2017-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Patrick Tsai |
| Maintainers | patosai |

## Links

- npm: https://www.npmjs.com/package/grunt-image-autoresize
- Repository: https://github.com/patosai/grunt-image-autoresize
- Homepage: https://github.com/patosai/grunt-image-autoresize#readme
- Issues: https://github.com/patosai/grunt-image-autoresize/issues
- npm.io page: https://npm.io/package/grunt-image-autoresize

## Dependencies (3)

- [gm](https://npm.io/package/gm.md) ^1.23.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [promise](https://npm.io/package/promise.md) ^8.0.1

## Recent versions

- 0.0.5 (latest) — 2017-11-10
- 0.0.4 — 2017-10-12
- 0.0.2 — 2017-10-12

## README

grunt-image-autoresize
=============

Automatically resizes images if the width or height is greater than a certain dimension. Keeps the aspect ratio.

For example, let's say you set the maximum dimension setting to 1000px. If an image is 2000x1000px, it gets resizes it to 1000x500px. If the image is 1000x2000px, it becomes 500x1000px.

The default max dimension is 800 pixels and can be changed. With the default option, the 2000x1000px image would be resized to 800x400px.

This uses ImageMagick, so it requires ImageMagick to be installed. Thus this only supports images supported by ImageMagick.

## Config
```javascript
grunt.initConfig({
    image_autoresize: {
        target_name_here: {
            maxdimension: 1000, // optional
            files: [{
              cwd: 'current working directory here',
              src: '**/*.{png,jpg}',
              dest: 'some output directory here'
            }]
        }
    }
})
```

The `files` value is an array of objects, the specifics of which can be read in [Grunt globbing pattern docs](https://gruntjs.com/configuring-tasks#globbing-patterns).

## Example configuration
```javascript
grunt.initConfig({
    image_autoresize: {
        target_name_here: {
            files: [{
              cwd: 'static/img',
              src: '**/*.{png,jpg}',
              dest: 'public/img'
            }]
        }
    }
})
```

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