Posted by: pressmart on: October 31, 2009
Hello Everybody,
Recently I have written new Image Thumb Generator class for PHP for one of my project. The class is having very small footprint and easy to use, just wanna share with all of you. It is available for download here. This class uses GD Library for generating thumb images, so make sure you have GD Library Extension enabled before use it.
Usage:
include 'image.class.php';
$image = new Imagethumb(<source file path>, <Maintain Aspect Ratio(TRUE|FALSE)>[DEFAULT: FALSE]);
$image->getThumb('thumb file path to save', (int)<width>, (int)<height>);
Example:
include 'image.class.php';
$image = new Imagethumb('Blue hills.jpg', true);
$image->getThumb('thumb.jpg', 125, 125);
Comments are welcomed….
1 | Djmixmancar
November 12, 2009 at 3:25 pm
Hola, Amigo, Mi consulta es como uso , este class, En mi caso
yo tengo mi codigo para subir imagen,
$SIZE )
{
echo “El Servidor acepta sólo archivos de tamaño menor que $SIZE.”;
echo ” Ingrese de Nuevo su Aviso“;
exit;
}
if(!in_array($tipo,$imagetypes))
{
echo “El Servidor acepta sólo imagenes”;
echo ” Ingrese de Nuevo su Aviso“;
exit;
}
$nombreaponer=CaracterBuscar($archivo_name);
$alternativo=”";
while (@fopen($UPLOAD_DIR.$alternativo.$nombreaponer,”r”))
{
$alternativo++;
}
$nombreaponer=$alternativo.$nombreaponer;
copy($archivo,$UPLOAD_DIR.$nombreaponer);
unlink($archivo);
-!!>