Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

image-file-resize

arun-kataria3.4kISC1.0.5

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

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

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

Install

npm install image-file-resize --save

Examples of how to use it

    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.