Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/12/2010, 21:36
jbec
 
Fecha de Ingreso: noviembre-2010
Mensajes: 5
Antigüedad: 13 años, 6 meses
Puntos: 0
Exclamación Problema con thumbnail

Urgente! tengo un problema,

al tratar de cortar una imagen png, me aparece el siguiente error:

"
Fatal error: imagepng() [<a href='function.imagepng'>function.imagepng</a>]: gd-png: fatal libpng error: zlib error in C:\Users\JonathanEstay\Documents\Localhost\miWEB\p roceso_thumb.php on line 101
"


aqui va el codigo:

$archivo = "consultores2.png";
$nuevo_tipo= "consultores2si.png";
$tipo= "png";

$tamano = 50;
list($ancho, $alto) = getimagesize($archivo);
if($ancho>$alto)
{
$new_alto = $tamano;
$new_ancho = ($ancho/$alto)*$new_alto;

$x = ($ancho-$alto)/2;
$y = 0;
}
else
{
$new_ancho = $tamano;
$new_alto = ($alto/$ancho)*$new_ancho;

$y = ($alto-$ancho)/2;
$x = 0;
}


if(($tipo == "png") || ($tipo == "PNG"))
{
$origen = imagecreatefrompng($archivo);
$temp = imagecreatetruecolor($tamano, $tamano);
imagecopyresampled($temp, $origen, 0, 0, $x, $y, $new_ancho, $new_alto, $ancho, $alto);
imagepng($temp, "mini_fotos_usuarios/nueva_".$nuevo_tipo, 100);
imagedestroy($temp);
imagedestroy($origen);
}