Skip to content

Resize image with a custom width and height but keeps the aspect ratio

License

Notifications You must be signed in to change notification settings

quevlu/resize-image-ratio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
    }

About

Resize image with a custom width and height but keeps the aspect ratio

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published