-
-
Save parzibyte/25223b6acd10ff40a242342eb70bc48c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$rutaImagenOriginal = "original.jpg"; | |
# La abrimos como un recurso. Nota: uso imagecreatefromjpeg porque es una JPEG, si fuera | |
# una PNG, usa imagecreatefrompng | |
$imagenOriginal = imagecreatefromjpeg($rutaImagenOriginal); | |
$calidad = 20; // Valor entre 0 y 100. Mayor calidad, mayor peso | |
header("Content-Type: image/jpeg"); | |
imagejpeg($imagenOriginal, null, $calidad); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment