Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/08/2006, 09:33
Avatar de giotari
giotari
Usuario no validado
 
Fecha de Ingreso: mayo-2003
Ubicación: Chile
Mensajes: 295
Antigüedad: 20 años, 10 meses
Puntos: 0
no me funciona el thumb

estoy ocupando este script para hacerlo:

<?php
$anchura=$_GET['ancho'];
$hmax= $_GET['alto'];
$nombre=basename($_GET['ruta']);
$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/jpeg");imagejpeg($thumb);}
if($datos[2]==3){header("Content-type: image/png");imagepng($thumb); }
imagedestroy($thumb);
?>

y la llamo:

http://www.patrimoniovina.cl/admplus...ho=120&alto=80

pero me envia un error:

No se puede mostrar la imagen “http://www.patrimoniovina.cl/admplus...o=120&alto=80” porque contiene errores.

no puedo encontrar el porque...