watermark pics on the server?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pete-KT
    Workin With The Devil
    • Oct 2004
    • 51532

    #1

    watermark pics on the server?

    anyone know of a program I can put on the server and have it watermark all my pics without downloading and reuploading my files?
  • Chio
    Confirmed User
    • Oct 2002
    • 8002

    #2
    Yes. Gallery 2

    I seo'd my hair yesterday and today it's pr7!
    RIP Texas Dreams

    Are you a content producer or program owner sick of tube sites? Contact me on ICQ: 39-183769

    Comment

    • SmokeyTheBear
      ►SouthOfHeaven
      • Jun 2004
      • 28609

      #3
      save the following as .htaccess
      this is what the htaccess should look like ( put it in the directory with the pics

      Code:
      AddHandler watermarked .jpg
      AddHandler watermarked .jpeg
      AddHandler watermarked .gif
      AddHandler watermarked .png
      
      Action watermarked http://www.yoursite.com/watermarkscript.php
      then the watermarkscript.php should look like this , it can reside anywhere , just point the htaccess to this file..

      make a watermark.png and place it int he same directory as the watermarkscript.php

      Code:
      <?php
      $watermark = "watermark.png";
      $image = $_SERVER["PATH_TRANSLATED"];
      
      if (empty($image)) die();
      
      if (!file_exists($image)) {
         header("404 Not Found");
         echo "File Not Found."; die();
      }
      
      $outputType = getFileType($image);
      
      watermark($image, $watermark, $outputType);
      
      /**
         Outputs the image $source with $watermark in the lower right corner.
         @param $source the source image
         @param $watermark the watermark to apply
         @param $outputType the type to output as (png, jpg, gif, etc.)
                            defaults to the image type of $source if left blank
      */
      function watermark($source, $watermark, $outputType="") {
         $sourceType = getFileType($source);
         $watermarkType = getFileType($watermark);
      
         if (empty($outputType)) $outputType = $sourceType;
         
         header("Content-type:image/$outputType");
      
         // Derive function names
         $createSource = "ImageCreateFrom".strtoupper($sourceType);
         $showImage = "Image".strtoupper($outputType);
         $createWatermark = "ImageCreateFrom".strtoupper($watermarkType);
      
         // Load original and watermark to memory
         $output = $createSource($source);
         $logo = $createWatermark($watermark);
         ImageAlphaBlending($output, true);
      
         // Find proper coordinates so watermark will be in the lower right corner
         $x = ImageSX($output) - ImageSX($logo);
         $y = ImageSY($output) - ImageSY($logo);
      
         // Display
         ImageCopy($output, $logo, $x, $y, 0, 0, ImageSX($logo), ImageSY($logo));
         $showImage($output);
      
         // Purge
         ImageDestroy($output);
         ImageDestroy($logo);
      }
      
      function getFileType($string) {
         $type = strtolower(eregi_replace("^(.*)\.","",$string));
         if ($type hahahaha "jpg") $type = "jpeg";
         return $type;
      }
      ( hahaha should read == )
      hatisblack at yahoo.com

      Comment

      • SmokeyTheBear
        ►SouthOfHeaven
        • Jun 2004
        • 28609

        #4
        make sure you change that 3rd to last line that says "hahaha" to "==" without the quotes
        hatisblack at yahoo.com

        Comment

        • Chio
          Confirmed User
          • Oct 2002
          • 8002

          #5
          Very cool Smokey.

          I seo'd my hair yesterday and today it's pr7!
          RIP Texas Dreams

          Are you a content producer or program owner sick of tube sites? Contact me on ICQ: 39-183769

          Comment

          • SmokeyTheBear
            ►SouthOfHeaven
            • Jun 2004
            • 28609

            #6
            Originally posted by Chio
            Very cool Smokey.
            yah i would like to modify it so you can make it only watermark pics when they are hotlinked or change the watermark to a different larger one , but im unsure of the htaccess
            hatisblack at yahoo.com

            Comment

            • SmokeyTheBear
              ►SouthOfHeaven
              • Jun 2004
              • 28609

              #7
              hopefully someone will modify it for us.
              hatisblack at yahoo.com

              Comment

              • Chio
                Confirmed User
                • Oct 2002
                • 8002

                #8
                Originally posted by SmokeyTheBear
                yah i would like to modify it so you can make it only watermark pics when they are hotlinked or change the watermark to a different larger one , but im unsure of the htaccess

                Take a look at gallery 2 watermark code. It does that.

                Example:

                It should have skarkyfarts logo on the bottom.

                Now click the link below and refresh to see the non hotlink version.

                http://www.sharkyfarts.com/gallery/v...etski.jpg.html

                EDIT: You can set different watermark files as well depending on what's happening... viewed on site, hotlinked, etc.
                Last edited by Chio; 01-25-2006, 06:02 PM.

                I seo'd my hair yesterday and today it's pr7!
                RIP Texas Dreams

                Are you a content producer or program owner sick of tube sites? Contact me on ICQ: 39-183769

                Comment

                • Grapesoda
                  So Fucking Banned
                  • Jul 2003
                  • 46234

                  #9
                  Originally posted by Pete-KT
                  anyone know of a program I can put on the server and have it watermark all my pics without downloading and reuploading my files?

                  hit woj up . . . he scripted one for me

                  Comment

                  • SmokeyTheBear
                    ►SouthOfHeaven
                    • Jun 2004
                    • 28609

                    #10
                    Originally posted by Chio
                    Take a look at gallery 2 watermark code. It does that.

                    Example:

                    It should have skarkyfarts logo on the bottom.

                    Now click the link below and refresh to see the non hotlink version.

                    http://www.sharkyfarts.com/gallery/v...etski.jpg.html

                    EDIT: You can set different watermark files as well depending on what's happening... viewed on site, hotlinked, etc.
                    hatisblack at yahoo.com

                    Comment

                    • MikeVega
                      **Porntrepreneur**
                      • Jul 2004
                      • 12788

                      #11
                      That's fucking cool ... that's exactly what pete was looking for ...


                      Mike Vega-ICQ:253868499-AIM:mikeydicevega

                      Comment

                      • JoeMeca
                        So Fucking Banned
                        • Nov 2005
                        • 2266

                        #12
                        thanks smoky!

                        Comment

                        • Pete-KT
                          Workin With The Devil
                          • Oct 2004
                          • 51532

                          #13
                          DAMM SMOKEY YOU ARE THE MAN, I owe you a drink in phoenix bro, thats exactly what i want. Thanks Bro

                          Comment

                          Working...