Ejemplo n.º 1
0
     //create the preview
     $preview = new imageObject("", "img.jpg");
     if ($what == "text") {
         //watermark with text
         $preview->watermarkText($text, $font, $c, $size, $left, $top, $rotation);
         echo $preview->preview;
     } else {
         //watermark with image
         //get the actual watermark image if it was converted for use with the configurator
         if (file_exists("watermarker/images/" . substr($image_url, 0, strlen($image_url) - 4))) {
             $image_url = "watermarker/images/" . substr($image_url, 0, strlen($image_url) - 4);
         } else {
             $image_url = "watermarker/images/" . $image_url;
         }
         echo "<img src='" . $image_url . "'/>";
         $preview->watermarkImage($image_url, $left, $top, $rotation, $transparency = 100);
         echo $preview->preview;
     }
     break;
 case "save":
     //save configuration to db
     if (!GALLERY_ADMIN_MODE) {
         cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
     }
     $wm['text_size'] = $_GET['size'];
     $wm['top'] = $_GET['top'];
     $wm['left'] = $_GET['left'];
     $wm['text'] = $_GET['text'];
     $wm['rotation'] = $_GET['rotation'];
     $wm['color'] = $_GET['color'];
     $wm['font'] = $_GET['font'];