Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/10/2006, 16:12
yoelis
 
Fecha de Ingreso: agosto-2003
Mensajes: 68
Antigüedad: 20 años, 8 meses
Puntos: 0
Prueba con esto:
Primero crea un archivo llamado redimensionar.php como te indico aqui, $dir es el directorio dente se encuentra la imagenes

redimensionar.php
Código HTML:
$dir = "./images/int/";
$vNombre = $dir.$_GET['imagen'];
$anchura=70; 
$hmax=70; 
$nombre=$vNombre; 
$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); 
imagecopyresampled($thumb, $img, 0, 0, 0, 0, $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/pjpeg");imagejpeg($thumb);} 
if($datos[2]==3){header("Content-type: image/png");imagepng($thumb); } 
imagedestroy($thumb);
Luego donde quiere que te aparezca la imagen coloca lo siguiente:

<img src='redimensionar.php?imagen=<?=$file?> border='0'>

donde $file es el nombre de la imagen...

Espero que te ayude...
__________________
AdsParaTuWeb.com