PHP Classes
elePHPant
Icontem

File: watermarker-example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Hossain Khan  >  PHP - GD Watermarker  >  watermarker-example.php  >  Download  
File: watermarker-example.php
Role: Example script
Content type: text/plain
Description: Sample Usage
Class: PHP - GD Watermarker
Apply an watermark image on another image
Author: By
Last change:
Date: 5 years ago
Size: 986 bytes
 

Contents

Class file image Download
<?php
require_once 'phpgdwatermarker.php'; // Add water-marker library

$watermarker = new PhpGdWatermarker('pgwatermark.png', PhpGdWatermarker::VALIGN_CENTER, PhpGdWatermarker::HALIGN_CENTER);
$watermarker->setImageOverwrite(FALSE); // [OPTIONAL] Default is TRUE
$watermarker->setEdgePadding(10); // [OPTIONAL] Default is 5
$watermarker->setWatermarkedImageNamePostfix('_'. time()); // [OPTIONAL] used IFF ImageOverwrite is FALSE, default is '_watermarked'

if($watermarker->applyWaterMark('sample-image.jpg')){
    echo
"APPLIED WATERMARK on TIMESTAMP-" . time();
} else {
    echo
$watermarker->getLastErrorMessage();
}

/* Simples Example
require_once 'phpgdwatermarker.php';
$watermarker = new PhpGdWatermarker('pgwatermark.png');
if($watermarker->applyWaterMark('sample-image.jpg')){
    echo "APPLIED WATERMARK on TIMESTAMP-" . time();
} else {
    echo $watermarker->getLastErrorMessage();
}
// That's all you need to apply watermark in the center */

?>