Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

251
Vistas
Javascript Canvas, resize image

I wonder how to use canvas in JS. I have the following questions:

  1. Let's say I have inputted an image and on my page I can access its src of blob (as far as I know this is the best way to get the image dynamically):
<img ... src="blob...">

Now I want to get this image in my JS and then modify it (resize and so on). Is blob src enough to do that?

  1. When I'll resize the image with canvas, where to store that resized image? In input tag's value attribute or what? What's the best practice to resize image on front before sending it via network? That input is in my form as I want to send that resized image to my server, and not to overflow my network.

  2. Also, is it possible to paste a watermark on that image with JS?

Hope you got it, and huge thanks in advance!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can download and store your image as an Image object, it's not necessary to have it in your html.

You can draw it on a canvas using drawImage function, which let you draw the image with the proportion of your choice. You can use the same function to draw a watermark on the canvas.

Once you are happy with the image on the canvas you can get it as a blob using toBlob function and upload to your server

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda