Mini library for creating thumbs.
The library allows you to resize images by setting either the width or the height of the resulting thumb. The other dimension will be determined authomatically to preserve the ratio.
use \thumb\Thumb;
$img = new Thumb("image.jpg");
/**
* The following will create thumbsFolder/image.jpg
* with a width of 300 and a proportional height.
*/
$img->create(300, "thumbsFolder");
/**
* The following will create thumbsFolder/thumbName.jpg
* with a width of 300 and a proportional height.
*/
$img->create(300, "thumbsFolder", "thumbName.jpg", Thumb::WIDTH);
/**
* The following will create thumbsFolder/thumbName.jpg
* with a height of 300 and a proportional width.
*/
$img->create(300, "thumbsFolder", "thumbName.jpg", Thumb::HEIGHT);
/**
* The following will create thumbsFolder/image.jpg
* with a height of 300 and a proportional width.
*/
$img->create(300, "thumbsFolder", null, Thumb::HEIGHT);
The lib only supports jpg, gif and png files.
Any doubts just send me an email at ftestolin(at)gmail.com