Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/03/2008, 06:19
Avatar de darkgaze
darkgaze
 
Fecha de Ingreso: febrero-2006
Ubicación: Madrid, España
Mensajes: 462
Antigüedad: 18 años, 2 meses
Puntos: 2
Exclamación Re: redimensionar imagenes. Ayuda urgente, por favor

Efectivamente faltaba codigo.
ahora queda así:

Código PHP:
if(!empty($_FILES["archivo"])){
        
$temp $_FILES["archivo"]["tmp_name"];
        
//COMPROBAR QUE TIENE EL FORMATO ADECUADO DE NOMBRE Y .JPG
        
$datos getimagesize($temp);

        
//GENERAMOS LOS NOMBRES DEFINITIVOS
        
$archivo $id_casa '_' $id_foto '.jpg';
        
$id_ftp ConectarFTP();
        if (
$id_ftp != false){

            
$ratio $datos[0]/$datos[1];
            
$alto floor(100/$ratio);

            
$redimensionada imagecreate(100,$alto);
            
$source imagecreatefromjpeg($temp);
            if (!
$source){ print "mal"; exit;}
            if (!
imagecopyresized ($redimensionada$source0000100$alto$datos[0], $datos[1]))
            {
$fallido true;}
            else {
                
ftp_chdir($id_ftp"html/casas-rurales-avila/fotos/");
                
imagejpeg($redimensionada,$archivo,100);
                
imagedestroy($redimensionada);
                
imagedestroy($source);
            }
        }
        else{
            
$fallido true;
        }
        
ftp_close($id_ftp); 
y lo de imagen grande lo he quitado
__________________
Darkgaze