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

299
Vistas
How to resize an image keeping aspect ratio with cropperjs

I'm trying to resize an image to a predefined size, keeping the aspect ratio of it. I've been using the following code to get the image data, but I don't know how to resize.

cropper.getCroppedCanvas().toDataURL('image/jpeg');
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can potentially use

cropper.getCroppedCanvas({ width: DESIRED_WIDTH, height: DESIRED_HEIGHT}).toDataURL(ORIGINAL_MIME_TYPE);

Its important to specify the original mime type of the image (png/gif etc) because otherwise you may end up with a significantly bigger image size in terms of file size.

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