"; // echo "Alto = " . $new_h . "
"; $aspect_ratio = $new_h / $new_w; $new_w = $picsize; $new_h = abs($new_w * $aspect_ratio); //echo "Nuevo Ancho = " . $new_w . "
"; //echo "Nuevo Alto = " . $new_h . "
"; //die (); $dst_img = @ImageCreateTrueColor($new_w,$new_h)or die("Cannot Initialize new GD image stream"); imagecopyresampled($dst_img,$img,0,0,0,0,$new_w,$new_h,imagesx($img),imagesy($img)); header('Content-type: '.$tipo.''); imagejpeg($dst_img,NULL,100); imagedestroy($dst_img); ?>