Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("class.thumbnail.php");
- // load class
- $thumb = new thumbnail();
- $file = '../image/Stonehenge.jpg';
- // load filename
- $thumb->load($file);
- // get file information
- $info = $thumb->getsize(); // returns width/height;
- // resize image
- $x = 0;
- $y = 0;
- $thumb->resize(
- //$x,
- //$y,
- //true
- );
- // add watermark
- $valign = 'bottom';
- $halign = 'left';
- $vmargin = 10;
- $hmargin = 5;
- $watermark_file = 'watermark/watermark.jpg';
- $thumb->watermark(
- $watermark_file,
- 'RIGHT',
- 'CENTER',
- $vmargin,
- $hmargin);
- // add text watermark
- $thumb->watermarkText(
- 'Watermark',
- '00CC00',
- 'font/CooperBlackStd-Italic.otf',
- 12,
- 45,
- 'BOTTOM',
- 'LEFT',
- 5,
- 5
- );
- // save as png
- $file = $thumb->save(
- "file.png",
- "png",
- 9);
- // display as JPEG
- $thumb->display(
- "jpg",
- 90);
- ?>
Add Comment
Please, Sign In to add comment