Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 22, 2022 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/ce68fe8ecb9be8a9481e856f8b5c2cd7 to your computer and use it in GitHub Desktop.
Save parzibyte/ce68fe8ecb9be8a9481e856f8b5c2cd7 to your computer and use it in GitHub Desktop.
const archivo = $imagen.files[0];
const blob = await comprimirImagen(archivo, parseInt($calidad.value));
const url = URL.createObjectURL(blob);
const enlace = document.createElement("a");
enlace.href = url;
enlace.download = "Imagen comprimida.jpg";
enlace.click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment