I have an api that links me directly to an image. When the User Clicks a button I want the image to be resized and then downloaded. Currently I'm using the file-saver npm package to download the image like so;
const downloadImage = (url,width=0,height=0) => {
console.log("downloading"+url)
saveAs(url, 'image.jpg') // Put your image url here.
}
This lets the user download the image however I'd like to resize the image and then prompt the user with a download if a non default width or height is used in the function. How can I achieve this?