<?php
// Variables que indican el archivo de la imagen y el nuevo tamano
$filename = "./imagenes/11974726662819-2.jpg";
// Content-type para el navegador
header('Content-type: image/jpeg');
// Se obtienen las nuevas dimensiones
$newwidth = 120; ///forzamos la imagen al tamaƱo deseado
$newheight =
floor( $height *
(120 /
$width ) );
///la altura la obtenemos proporcionalmente para no deformar la imagen
// Cargar la imagen
$thumb = imagecreate($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
// Redimensionar
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Mostrar la nueva imagen
imagejpeg($thumb);
?>
0 comment about "Thumbnail de tus fotografias con PHP (2)"