Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/12/2011, 10:42
abrahamT
 
Fecha de Ingreso: noviembre-2011
Mensajes: 18
Antigüedad: 12 años, 5 meses
Puntos: 1
Respuesta: detectar ancho de imagen

A ver si te sirve de algo para que te des una idea y pruebes algo asì:

Código PHP:

list($width,$height)=getimagesize($uploadedfile);
            
$ancho=getimagesize($uploadedfile);

            if (
$ancho[0]<400)
            {
                
$newwidth=el_ancho;
                
$newheight=($height/$width)*$newwidth//sacamos altura proporcional
                
$tmp=imagecreatetruecolor($newwidth,$newheight);
            
                
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
    
                            
                
        }