Example #1
0
 function watermark($file, $watermark, $dir)
 {
     require_once 'admin/lib/imageworkshop.lib.php';
     $info = pathinfo($file);
     if ($info['extension'] != 'gif') {
         $imageLayer = new ImageWorkshop(array("imageFromPath" => $file));
         $watermarkLayer = new ImageWorkshop(array("imageFromPath" => $watermark));
         $imageLayer->addLayer(1, $watermarkLayer, 5, 5, "RB");
         $createFolders = false;
         $backgroundColor = null;
         $imageQuality = 100;
         $imageLayer->save($dir, $info['filename'] . '.' . $info['extension'], $createFolders, $backgroundColor, $imageQuality);
     }
 }