Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/06/2006, 13:15
escan_0
 
Fecha de Ingreso: febrero-2003
Mensajes: 763
Antigüedad: 21 años, 3 meses
Puntos: 2
muchas gracias por cierto ¿como podria modificarlo para que que si la foto es menor de 150 deje tal como esta lo intentado asi pero la sigue conviertiendo a 150, miren:

Código PHP:
<?php 
$anchura
=180
$hmax=180
$nombre=$_GET['imagen']; 
$datos getimagesize($nombre); 
if(
$datos[2]==1){$img = @imagecreatefromgif($nombre);} 
if(
$datos[2]==2){$img = @imagecreatefromjpeg($nombre);} 
if(
$datos[2]==3){$img = @imagecreatefrompng($nombre);} 
$ratio = ($datos[0] / $anchura); 
$altura = ($datos[1] / $ratio); 
if(
$altura>$hmax){$anchura2=$hmax*$anchura/$altura;$altura=$hmax;$anchura=$anchura2;} 
$thumb imagecreatetruecolor($anchura,$altura); 
$juan imagecreatetruecolor($datos[1],$datos[2]); 
imagecopyresampled($thumb$img0000$anchura$altura$datos[0], $datos[1]); 
if(
$datos[2]==1){header("Content-type: image/gif"); imagegif($thumb);} 
if(
$datos[2]==2){header("Content-type: image/jpeg");imagejpeg($thumb);} 
if(
$datos[2]==3){header("Content-type: image/png");imagepng($thumb); } 
if (
$datos[0] >= 180) {
imagedestroy($thumb); 
} else {
imagedestroy($juan);
}
?>

Última edición por Cluster; 16/06/2006 a las 14:41