Syed Abdul Baqi

PHP Image Thumb Generator

Posted 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….

About these ads

1 Response to "PHP Image Thumb Generator"

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);

-!!>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: