// Images folder, must end with slash. $images_folder = '/var/www/html/samples/php/watermark/case6/logo/'; // Save watermarked images to this folder, must end with slash. $destination_folder = '/var/www/html/samples/php/watermark/case6/dest/'; ################################################################################# # END OF SETTINGS ################################################################################# // Load functions for image watermarking include "watermark_text.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 $imgpath = $filename; // Where to save watermarked image $imgdestpath = $destination_folder . basename($filename); // create class instance $img = new Zubrag_watermark($imgpath); // shadow params $img->setShadow($drop_shadow, $shadow_color); // font params $img->setFont($font, $font_size); // Apply watermark $img->ApplyWatermark($text, $color, $angle, $offset_x, $offset_y); // Save on server $img->SaveAsFile($imgdestpath); // Output to browser //$img->Output(); // release resources $img->Free(); }