
04/12/2007, 06:18
|
| | Fecha de Ingreso: junio-2003
Mensajes: 778
Antigüedad: 21 años, 10 meses Puntos: 1 | |
Re: ¿Alternativa a la libreria GD? La funcion que utilizo en GD es esta
Código:
function createThumb($image, $newname){
$size = getimagesize ($image);
$height = $size[1];
$width = $size[0];
if ($width > $height) {
$newwidth = 80;
$newheight = round(($height*80)/$width);
} else {
$newheight = 80;
$newwidth = round(($width*80)/$height);
}
$src = imagecreatefromjpeg($image);
$im = imagecreatetruecolor($newwidth,$newheight);
imagecopyresampled($im,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
imagejpeg($im, $newname,50);
imagedestroy($im);
} // FIN CREO IMAGEN MINIATURA
La miniatura se genera con un ancho de 80, pero muy borrosa... |