Comunidad de diseño web y desarrollo en internet online

el mejor thumbnail

Citar            
MensajeEscrito el 22 Ago 2007 01:51 am
me gustaria saber segun su experienxia cual script o libreria hace thumbnails

rapidos , pekeños y de mayor calidad

para usarlos en una galeria en flash ya que yo hago una galeria pero mi libreria para hacer thumbnails tarda mucho en hacerlos , me pueden decir cual me recomiendan y repito que sea rapidos , pekeños y de mayor calidad supongo que debe haber uno que se adapte a flash gracias.

Por DiegoAzul

376 de clabLevel



 

Mx

firefox
Citar            
MensajeEscrito el 18 Sep 2007 03:33 pm
Este es bueno:

<?php

function photoCreateCropThumb ($p_thumb_file, $p_photo_file, $p_max_size, $p_quality = 75) {

$pic = @imagecreatefromjpeg($p_photo_file);

if ($pic) {
$thumb = @imagecreatetruecolor ($p_max_size, $p_max_size) or die ("Can't create Image!");
$width = imagesx($pic);
$height = imagesy($pic);
if ($width < $height) {
$twidth = $p_max_size;
$theight = $twidth * $height / $width;
imagecopyresized($thumb, $pic, 0, 0, 0, ($height/2)-($width/2), $twidth, $theight, $width, $height);
} else {
$theight = $p_max_size;
$twidth = $theight * $width / $height;
imagecopyresized($thumb, $pic, 0, 0, ($width/2)-($height/2), 0, $twidth, $theight, $width, $height);
}

ImageJPEG ($thumb, $p_thumb_file, $p_quality);
}

}

?>

Chaop!

Por luchope

38 de clabLevel



Genero:Masculino  

Bogota Colombia

firefox
Citar            
MensajeEscrito el 18 Sep 2007 03:34 pm
Mejor te lo pongo en codigo:

Código :

<?php

function photoCreateCropThumb ($p_thumb_file, $p_photo_file, $p_max_size, $p_quality = 75) {
 
    $pic = @imagecreatefromjpeg($p_photo_file);

    if ($pic) {
        $thumb = @imagecreatetruecolor ($p_max_size, $p_max_size) or die ("Can't create Image!");
        $width = imagesx($pic);
        $height = imagesy($pic);
        if ($width < $height) {
                $twidth = $p_max_size;
                $theight = $twidth * $height / $width;
                imagecopyresized($thumb, $pic, 0, 0, 0, ($height/2)-($width/2), $twidth, $theight, $width, $height);
        } else {
                $theight = $p_max_size;
                $twidth = $theight * $width / $height;
                imagecopyresized($thumb, $pic, 0, 0, ($width/2)-($height/2), 0, $twidth, $theight, $width, $height);
        }

        ImageJPEG ($thumb, $p_thumb_file, $p_quality);
    }

}

?>

Por luchope

38 de clabLevel



Genero:Masculino  

Bogota Colombia

firefox
Citar            
MensajeEscrito el 18 Sep 2007 03:35 pm
necesitas tener la libreria GD para hacer eso.

Por neohunter

Claber

563 de clabLevel

1 tutorial

 

Bogota, Colombia

firefox
Citar            
MensajeEscrito el 18 Sep 2007 03:38 pm
De acuerdo, lidgb superior a 2.0., para satisfacer la funcion "imagecreatetruecolor".

Si tuvieras una version menor, tendrias que utilizar solo la funcion imagecreate, pero con menor calidad... :(

Chaop!

Por luchope

38 de clabLevel



Genero:Masculino  

Bogota Colombia

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.