1.0.5 • Published 2 years ago

image-file-resize v1.0.5

Weekly downloads
74
License
ISC
Repository
github
Last release
2 years ago

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

npm.io

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.

KeyRequired/OptionalDescription
fileRequiredContain browser file object.
widthOptionalWidth of image required Default is 500
heightOptionalHeight of image required Default is 300
typeOptionalType of image required Default is jpeg

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