Ver Mensaje Individual
  #10 (permalink)  
Antiguo 16/02/2008, 12:21
okram
Invitado
 
Mensajes: n/a
Puntos:
Re: redimensionar imagen

Código PHP:
if($datos[0] > $ancho_max or $datos[1] > $alto_max) {
    
$alto = ($datos[1] / $ratio); 
    if(
$alto $alto_max) {
        
$ancho=$alto_max*$ancho_max/$alto;
        
$alto=$alto_max;
        
$ancho_max=$ancho;
    } 
    
$thumb imagecreatetruecolor($ancho_max,$alto); 
    
imagecopyresampled($thumb$img0000$ancho_max$alto$datos[0], $datos[1]); 
} else 
$thumb = &$img//Si no se hace la redimension, hacemos que el $thumb sea la misma imagen 
Un saludo,