PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Lionel Micault   Transparent Watermark   test.php   Download  
File: test.php
Role: Example script
Content type: text/plain
Description: test source
Class: Transparent Watermark
Apply a transparent watermark to protect images
Author: By
Last change:
Date: 19 years ago
Size: 635 bytes
 

Contents

Class file image Download
<?
include_once("transparentWatermark.inc");

//set file names
$logo="testlogo.png";
$image="testimage.jpg";
$markedImage="marked".$image;

//no compute new watermark on same image
if (!file_exists($markedImage) ) {
   
   
// open classe with logo
   
$WM=new transparentWatermark($logo);
   
   
// set logo's position (optional)
   
$WM->setStampPosition ( transparentWatermarkOnRight, transparentWatermarkOnBottom);
   
   
// create new image with logo
   
if (!$WM->markImageFile ( $image, $markedImage))
        die(
"Error:".$WM->getLastErrror()."\r\n");
}

// redirection to watermarked image
header("Location: $markedImage");
?>