jajajajajja lo siento soy algo despistado jajajaj aqui va
con esto genero 2 copyas una mediana una miniatura mas la original
pero la cosa es que me funciona pero las imagenes no resultan del todo buenas.
el sitio pa que lo vean es el siguiente
http://www.sketchbienesraices.com/catalogo.php
if($file_size){
if($file_type == "image/pjpeg" || $file_type == "image/jpeg"){
$new_img = imagecreatefromjpeg($file_tmp);
}elseif($file_type == "image/x-png" || $file_type == "image/png"){
$new_img = imagecreatefrompng($file_tmp);
}elseif($file_type == "image/gif"){
$new_img = imagecreatefromgif($file_tmp);
}
//list the width and height and keep the height ratio.
list($width, $height) = getimagesize($file_tmp);
//calculate the image ratio
$imgratio=$width/$height;
if ($imgratio>1){
$newwidth = $ThumbWidth;
$newheight = $ThumbWidth/$imgratio;
$newwidth2 = 90;
$newheight2 = 90/$imgratio;
}else{
$newheight = $ThumbWidth;
$newwidth = $ThumbWidth*$imgratio;
$newheight2 = 90;
$newwidth2 = 90*$imgratio;
}
if (function_exists(imagecreatetruecolor)){
$resized_img = imagecreatetruecolor($newwidth,$newheight);
$resized_img_mini = imagecreatetruecolor($newwidth2,$newheight2);
}else{
die("Error: Please make sure you have GD library ver 2+");
}
imagecopyresized($resized_img, $new_img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
imagecopyresized($resized_img_mini, $new_img, 0, 0, 0, 0, $newwidth2, $newheight2, $width, $height);
//finally, save the image
ImageJpeg ($resized_img,"$path_medium/$rand_name.$file_ext", 100);
ImageJpeg ($resized_img_mini,"$path_thumbs/$rand_name.$file_ext", 100);
ImageDestroy ($resized_img_mini);
ImageDestroy ($resized_img);
ImageDestroy ($new_img);
}
$resultimage=move_uploaded_file ($file_tmp, "$path_big/$rand_name.$file_ext");