Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/03/2009, 04:47
Operadormail
 
Fecha de Ingreso: junio-2003
Mensajes: 778
Antigüedad: 20 años, 10 meses
Puntos: 1
Gestion de miniaturas con la libreria GD

Hola a todos

Utilizo la libreria GD para crear miniaturas de las imagenes subidas al servidor, pero estas se ven muy pobres.

Este es el código que utilizo

Código:
$size = getimagesize ($image);	
$height = $size[1];
$width = $size[0];
						
if ($width > $height) {
	$newwidth = 100;
	$newheight = round(($height*100)/$width);
} else {
	$newheight = 100;
	$newwidth = round(($width*100)/$height);	
}							
$src = imagecreatefromjpeg($image);
$im = imagecreatetruecolor($newwidth,$newheight);
						imagecopyresampled($im,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
imagejpeg($im, $newname,100);
imagedestroy($im);
Alguna alternativa o sugerencia??

Muchas gracias