Código de minifoto.php:
Código :
<?php // Variables que indican el archivo de la imagen y el nuevo tamano $nombre = $_GET[$valor]; $filename = 'img/'.$nombre; //ubicacion de la foto $percent = 0.5; //echo "peba vale: $peba y filename vale: $filename"; // Content-type para el navegador header('Content-type: image/jpeg'); // Se obtienen las nuevas dimensiones list($width, $height) = getimagesize($filename); $newwidth = $width * $percent; $newheight = $height * $percent; // Cargar la imagen $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($filename); // Redimensionar imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Mostrar la nueva imagen imagejpeg($thumb); ?>
Codigo en otro archivo:
Código :
<?php echo "<img src=\"minifoto.php?valor=$archivos[$i]\"/>"; ?>