3.0.0 • Published 3 years ago

@quevlu/resize-image-ratio v3.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
3 years ago

resize-image-ratio

This library creates a new image file object and a preview from a file image object with a custom width an height keeping the same aspect ratio

Use

    import resizeImageRatio from '@quevlu/resize-image-ratio';

    const width = 640;
    const height = 480;

    const resizedFile = await resizeImageRatio(fileObject,width,height);

    console.log(resizedFile);

    {
        file: fileResized,
        preview: fileResizedPreview
    }