Code: Select all
// create simple square thumb for every image we want
// with 100px width and height
$th=new Thumbnailer('some_photo.jpg');
$th->thumbSquare(100)->save('thumb_some_photo.jpg');
Code: Select all
// 120px wide, 80px tall
$th=new Thumbnailer('any_photo.jpg');
$th->thumbFixed(120,80)->save('mythumb.jpg');
Code: Select all
// creating callback function for batch mode
function callback(& $thumb) {
// create symmetric photos (ratio will be 1:1)
// (640px means, the larger width or height will have at max 640px)
$thumb->thumbSymmetric(640)->save('/galleries/holiday_gallery/' . $thumb->getFilename());
// create its thumb
$thumb->thumbSquare(100)->save('/galleries/holiday_gallery/thumb_' . $thumb->getFilename());
}
// run batch mode
Thumbnailer::batch('callback', '/directory/with/photos/from/camera/');