# image-file-resize

> To resize or compress image file by weight and height. Image compression with extension: jpg/jpeg, svg, png, gif.

Latest version **1.0.5** (published 2022-02-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install image-file-resize
pnpm add image-file-resize
yarn add image-file-resize
bun add image-file-resize
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-02-24 |
| First published | 2020-04-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Arun kataria |
| Maintainers | arun_kataria |
| Keywords | font-end image compress, fontend image compress, ui image compress, image-compress, image-resize, compress images, images compress, img, minifier, image mini, picture, photo, minify image, image minify, image, image minify, compression, image compression, compression image, compress, compress image, image compress, image mini, mini image, reduce image size, image minify size, image compress size, image size minify, image lessen, jpeg compression, jpg compression, svg compression, png compression, gif compression, combine compress, jpeg, jpg, svg, png, gif, jpeg minify, jpg minify, svg minify, png minify, gif minify, compress jpeg, compress jpg, compress svg, compress png, compress gif, jpeg compress, jpg compress, svg compress, png compress, gif compress, jpegtran, mozjpeg, webp, guetzli, jpegRecompress, jpegoptim, tinify, pngquant, optipng, pngout, webp, pngcrush, svgo, gifsicle, giflossy, gif2webp, image min, react.js, angular |

## Links

- npm: https://www.npmjs.com/package/image-file-resize
- Repository: https://github.com/arun-kataria/image-file-resize
- Homepage: https://github.com/arun-kataria/image-file-resize#readme
- Issues: https://github.com/arun-kataria/image-file-resize/issues
- npm.io page: https://npm.io/package/image-file-resize

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2022-02-24
- 1.0.4 — 2021-06-28
- 1.0.3 — 2020-06-09
- 1.0.2 — 2020-04-21
- 1.0.1 — 2020-04-10
- 1.0.0 — 2020-04-10

## README

# image-file-resize
 
This node module to resize the image file according to width and height. Also you can change the extension of a file. And also it is very **lightweight**.

> [Live demo](https://react-rggk21.stackblitz.io/)

[![](https://cdn.buymeacoffee.com/buttons/v2/arial-red.png)](https://www.buymeacoffee.com/sdarunkataA)

## Install

```sh
npm install image-file-resize --save
```
## Examples of how to use it

```javascript
    import convert from 'image-file-resize';

    convert({ 
        file: e.target.files[0],  
        width: 600, 
        height: 400, 
        type: 'jpeg'
        }).then(resp => {
            // Response contain compressed and resized file
        }).catch(error => {
             // Error
        })
```

## Parameter to send
 Object need to send as a parameter and contain these data.

| Key | Required/Optional | Description |
| --- | --- | --- |
| `file` | **Required** | Contain browser file object. |
| `width` | Optional | Width of image required **Default is 500** |
| `height` | Optional | Height of image required **Default is 300** |
| `type` | Optional | Type of image required **Default is jpeg** |


You can convert image only in **jpg, gif, bmp, png, jpeg**.

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