Hola Ale21ale, aquí tienes otro ejemplo. Lo tengo puesto a 200 de alto, pero modificalo a tu gusto.
Código PHP:
$exte=".jpg";
$yafoto=($nomgos . $buffer . $exte);
$path = "../images3";
$max_size = 250000;
if (is_uploaded_file($userfile)) {
if ($userfile_size>$max_size) { echo "EL ARCHIVO ES DEMASIADO GRANDE (max. 250 KB).<br>\n"; exit; }
if (($userfile_type=="image/gif") || ($userfile_type=="image/pjpeg")) {
if (file_exists($path . $userfile_name)) { echo "EL ARCHIVO YA EXISTE.<br>\n"; exit; }
$res = copy($userfile, $path . $userfile_name);
if (!$res) {
echo "Error al subir la imágen!<br>\n"; exit; }
else
echo "La imagen se ha subido con exito<br>\n";
// echo "Nombre del Archivo: $userfile_name<br>\n";
// echo "Tamaño del Archivo: $userfile_size bytes<br>\n";
// echo "Formato del Archivo: $userfile_type<br>\n";
$img=imagecreatefromjpeg($userfile);
$bx=imagesx($img);
$by=imagesy($img);
$my=200;
$mx=intval($my*$bx/$by);
$im=imagecreatetruecolor ($mx, $my);
imagecopyresampled ($im, $img, 0, 0, 0, 0, $mx, $my, $bx, $by);
imagejpeg($im,"../images3/$yafoto",75);
unlink($path . $userfile_name);