Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

183
Visualizações
How to resize an image from a url and then download it in reactjs

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?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda