Este es mi script que he construido con info de por aki y por allá...ejecuta bien las instrucciones que hay salvo el momento en que debeb generar una miniatura ('thumbnail'), sube la imagen al server, me crea al copia con el prefijo pero no me crela el thumbnail a partir de la imagen copiada...(los thumbnails deberia ser de 128x96 si la imagen es de 640x480 que es el idela para las imagenes que habrán de alojar en la web)
alguien podria ayudarme a solucionar esto?
Código PHP:
if($HTTP_POST_FILES['userfile']['type']=="image/gif") { $extension = ".gif"; }
if($HTTP_POST_FILES['userfile']['type']=="image/jpeg") { $extension = ".jpg"; }
if($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") { $extension = ".jpeg"; }
$New_Name = md5($HTTP_POST_FILES['userfile']['name']).$extension;
rename($path.$HTTP_POST_FILES['userfile']['name'], $path.$New_Name);
//Clonamos la imagen con el prefijo thmb_ -> Thumbnail
$Thumb = $path."thmb_".$New_Name;
copy($path.$New_Name, $Thumb);
//--------------------------------------------
if($HTTP_POST_FILES['userfile']['type']=="image/gif") { $fuente = @imagecreatefromgif($Thumb ); }
if($HTTP_POST_FILES['userfile']['type']=="image/jpeg") { $fuente = @imagecreatefromjpeg($Thumb ); }
if($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") { $fuente = @imagecreatefromjpeg($Thumb ); }
$imgAncho = imagesx($fuente);
$imgAlto = imagesy($fuente);
$N_imgAncho = imagesx($fuente)/5;
$N_imgAlto = imagesy($fuente)/5;
$imagen = @ImageCreate($N_imgAncho, $N_imgAlto);
if(ImageCopyResized($fuente,$imagen,0,0,0,0,$N_imgAncho,$N_imgAlto,$imgAncho,$imgAlto)) echo "Thumb creada<br>";
echo "fuente: ".$fuente."<br>";
echo "thumb: ".$Thumb."<br>";
echo "ancho: ".$imgAncho."<br>";
echo "alto: ".$imgAlto."<br>";
echo "Nuevo ancho: ".$N_imgAncho."<br>";
echo "Nuevo alto: ".$N_imgAlto."<br>";
echo "fuente: ".$fuente."<br>";
echo "imagen: ".$imagen."<br>";
$peso = filesize($Thumb)/1024;
echo "tamaño thumb: ".$peso."Kb<br>";
muchas gracias a todos incluso a los que sólo leerán ell post! saludos