| Current Path : /var/www/html/mmishra/mm/ada/ |
| Current File : /var/www/html/mmishra/mm/ada/watermark_image_example.php |
<?php
#################################################################################
# Watermark Image script usage example
# For updates visit http://www.zubrag.com/scripts/
#################################################################################
// Images folder, must end with slash.
$images_folder = '/srv/www/websites/ada/images/';
// Save watermarked images to this folder, must end with slash.
$destination_folder = '/srv/www/websites/ada/watermark/';
// Path to the watermark image (apply this image as waretmark)
$watermark_path = '/srv/www/websites/ada/watermark1.jpg';
// MOST LIKELY YOU WILL NOT NEED TO CHANGE CODE BELOW
// Load functions for image watermarking
include("watermark_image.class.php");
// Watermark all the "jpg" files from images folder
// and save watermarked images into destination folder
foreach (glob($images_folder."*.jpg") as $filename) {
// Image path
$image_path = $filename;
// Where to save watermarked image
$imgdestpath = $destination_folder . basename($filename);
// Watermark image
$img = new Zubrag_watermark($image_path);
$img->ApplyWatermark($watermark_path);
$img->SaveAsFile($imgdestpath);
$img->Free();
}
?>