<?php
include("class.thumbnail.php");
// load class
$thumb = new thumbnail();
$file = 'example.png';
// load filename
$thumb->load($file);
// get file information
$info = $thumb->getsize(); // returns width/height;
// resize image
$thumb->resize($x,
$y,
true);
// add watermark
$thumb->watermark('watermark.png',
'RIGHT',
'CENTER',
10,
$hmargin);
// add text watermark
$thumb->watermarkText('Watermark',
'00CC00',
'font.ttf',
'BOTTOM',
'LEFT',
5,
5);
// save as png
$file = $thumb->save("file.png",
"png",
9);
// display as JPEG
$thumb->display("jpg",
85);
?>
|