subir 3 fotos? para que subir 3 fotos si con una hay bastante usa este script, crea un archivo llamado thumbnails.php y lo enganchas:
Código PHP:
<?php
header('Content-type: image/jpeg');
header('Content-type: image/gif');
header('Content-type: image/png');
$new_width = $_GET["ancho"];
$new_height = $_GET["alto"];
$ruta = $_GET["ruta"];
$image = "../" . $ruta;
if(preg_match("/.jpg/i", "$image"))
{
$format = 'image/jpeg';
}
if (preg_match("/.gif/i", "$image"))
{
$format = 'image/gif';
}
if(preg_match("/.png/i", "$image"))
{
$format = 'image/png';
}
switch($format)
{
case 'image/jpeg':
$fuente = imagecreatefromjpeg($image);
break;
case 'image/gif';
$fuente = imagecreatefromgif($image);
break;
case 'image/png':
$fuente = imagecreatefrompng($image);
break;
}
$imagen = imagecreatetruecolor($new_width , $new_height);
imagealphablending($imagen, false);
imagecopyresampled($imagen, $fuente, 0, 0, 0, 0, $new_width, $new_height, imagesx($fuente),imagesy($fuente)); // redimensiona
header("Content-type: image/jpeg");
header("Content-type: image/gif");
switch($format)
{
case 'image/jpeg':
imagejpeg($imagen);
break;
case 'image/gif';
imagegif($imagen);
break;
case 'image/png':
imagepng($imagen);
break;
}
?>
luego pasale las fotos en el tamaño que quieras:
<img src="scripts/thumbnails.php?ruta=tufoto.jpg&ancho=85&alto=64" />
Automáticamente te ajusta el tamaño y el peso, es decir, una foto de 1024x768 de 1MB, si le dices 100x80 quizá te pese entre 20 y 50Kb sin perder resolución