Syed Abdul Baqi

Archive for the ‘gd’ Category

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