CSS gurus inside please....watermarking with css

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Oracle Porn
    Affiliate
    • Oct 2002
    • 24433

    #1

    CSS gurus inside please....watermarking with css

    im trying to watermark some thumbs
    Code:
     a img{
    	border: 1px solid #000000;
    	width: 240px;
            height: 180px;
      	background:transparent url(play.png) bottom right no-repeat;
    it works but the only problem is that my original thumb i want to watermark is OVER the play.png instead of UNDER it, anyone knows what i need to add? searching google for too long now

    thanks


  • grumpy
    Too lazy to set a custom title
    • Jan 2002
    • 9870

    #2
    make your image the background, put the watermark over it as a thumb
    Don't let greediness blur your vision | You gotta let some shit slide
    icq - 441-456-888

    Comment

    • SmellyNose
      Confirmed User
      • Aug 2009
      • 206

      #3
      Originally posted by grumpy
      make your image the background, put the watermark over it as a thumb
      !rucnoc I
      I'm a PHP developer - 594086663 - [email protected]

      Comment

      • Va2k
        I’m still alive barley.
        • Oct 2001
        • 10060

        #4
        Yea what grump said!

        Comment

        • quantum-x
          Confirmed User
          • Feb 2002
          • 6863

          #5
          <div style="background: url(yourimage.png) top left no-repeat;"><img src="watermark.png" /></div>
          PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

          Comment

          • SmellyNose
            Confirmed User
            • Aug 2009
            • 206

            #6
            Or, if your server is linux, you could use 'composite' to make a watermarked version. I'd go with this approach because if you just use CSS people can download the original image anyway.

            Code:
            composite -gravity southeast -dissolve 15 watermark.jpg original.jpg watermarked/original.jpg
            Or, you could do something like this (untested):

            Code:
            for file in `ls images/*.jpg`; do composite -gravity southeast -dissolve 15 watermark.jpg $file watermarked/$file; done
            I'm a PHP developer - 594086663 - [email protected]

            Comment

            • Oracle Porn
              Affiliate
              • Oct 2002
              • 24433

              #7
              shit that would be impossible no way around it?


              Comment

              • Oracle Porn
                Affiliate
                • Oct 2002
                • 24433

                #8
                Originally posted by AdultStoriesNow
                Or, if your server is linux, you could use 'composite' to make a watermarked version. I'd go with this approach because if you just use CSS people can download the original image anyway.

                Code:
                composite -gravity southeast -dissolve 15 watermark.jpg original.jpg watermarked/original.jpg
                Or, you could do something like this (untested):

                Code:
                for file in `ls images/*.jpg`; do composite -gravity southeast -dissolve 15 watermark.jpg $file watermarked/$file; done
                since these are thumbs that watermark is just a "play button", i have no need to hard watermark it. thanks for this anyway, worse come to worse ill do it.


                Comment

                • SmellyNose
                  Confirmed User
                  • Aug 2009
                  • 206

                  #9
                  Or if your site is in PHP you could do something like this:

                  Code:
                  $base_dir = getcwd(); // meh
                  $f_file = $base_dir . $file;
                  $w_file = $base_dir . "/watermarked/".$file;
                  $water_file = $base_dir.'watermark.png';
                  
                  $file = $_GET['file']; // Add security measures
                  header("Content-Type: image/jpeg");
                  
                  if(!file_exists($f_file)) {
                     readfile($base_dir . "invalid_image.jpg");
                     exit;
                  }
                  
                  if(!file_exists($w_file)) {
                     readfile($w_dir);
                     exit;
                  }
                  
                  //Borrowed from http://articles.sitepoint.com/article/watermark-images-php as this is in a quick reply box so won't be writing new code as this is an example/idea :P
                  
                  $watermark = imagecreatefrompng($water_file);
                  $watermark_width = imagesx($watermark);  
                  $watermark_height = imagesy($watermark);  
                  $image = imagecreatetruecolor($watermark_width, $watermark_height);  
                  $image = imagecreatefromjpeg($f_file);
                  $size = getimagesize($f_file);  
                  $dest_x = $size[0] - $watermark_width - 5;  
                  $dest_y = $size[1] - $watermark_height - 5;  
                  imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100);  
                  imagejpeg($image);  
                  imagedestroy($image);  
                  imagedestroy($watermark);
                  
                  //Some code here to put the watermarked image into $base_dir . 'watermarked/'.$file so the image is cached for next time
                  I'm a PHP developer - 594086663 - [email protected]

                  Comment

                  • SmellyNose
                    Confirmed User
                    • Aug 2009
                    • 206

                    #10
                    Ahhhh. If that's the case then the background-image being the actual thumb is best. Why can't you do that?
                    I'm a PHP developer - 594086663 - [email protected]

                    Comment

                    • calmlikeabomb
                      Confirmed User
                      • May 2004
                      • 1323

                      #11
                      It's called using the z-index and it only works when elements have a set position type.

                      Also, it's pointless and you should be using PHP or another language/software to create images with real water marks.
                      subarus.

                      Comment

                      • Oracle Porn
                        Affiliate
                        • Oct 2002
                        • 24433

                        #12
                        Originally posted by AdultStoriesNow
                        Or if your site is in PHP you could do something like this:

                        Code:
                        $base_dir = getcwd(); // meh
                        $f_file = $base_dir . $file;
                        $w_file = $base_dir . "/watermarked/".$file;
                        $water_file = $base_dir.'watermark.png';
                        
                        $file = $_GET['file']; // Add security measures
                        header("Content-Type: image/jpeg");
                        
                        if(!file_exists($f_file)) {
                           readfile($base_dir . "invalid_image.jpg");
                           exit;
                        }
                        
                        if(!file_exists($w_file)) {
                           readfile($w_dir);
                           exit;
                        }
                        
                        //Borrowed from http://articles.sitepoint.com/article/watermark-images-php as this is in a quick reply box so won't be writing new code as this is an example/idea :P
                        
                        $watermark = imagecreatefrompng($water_file);
                        $watermark_width = imagesx($watermark);  
                        $watermark_height = imagesy($watermark);  
                        $image = imagecreatetruecolor($watermark_width, $watermark_height);  
                        $image = imagecreatefromjpeg($f_file);
                        $size = getimagesize($f_file);  
                        $dest_x = $size[0] - $watermark_width - 5;  
                        $dest_y = $size[1] - $watermark_height - 5;  
                        imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100);  
                        imagejpeg($image);  
                        imagedestroy($image);  
                        imagedestroy($watermark);
                        
                        //Some code here to put the watermarked image into $base_dir . 'watermarked/'.$file so the image is cached for next time
                        thanks ill try it, i can't edit that actually page but only the css header and footer (not actually content aka thumbs)...thats the script i use
                        Last edited by Oracle Porn; 02-07-2010, 07:55 AM.


                        Comment

                        • SmellyNose
                          Confirmed User
                          • Aug 2009
                          • 206

                          #13
                          Originally posted by Oracle Porn
                          thanks ill try it, i can't edit that actually page but only the css...thats the script i use
                          What does your HTML and CSS look like?

                          Might be able to come up with something if we can see the layout of the HTML.

                          Though, I definitely think you should edit the script you're using and do it by setting your image to the background image, and using the thumb image in <img src=''>
                          I'm a PHP developer - 594086663 - [email protected]

                          Comment

                          • MetaMan
                            I AM WEB 2.0
                            • Jan 2003
                            • 28682

                            #14
                            position: relative;
                            z-index: 0;

                            then for the overtop

                            position: relative;
                            z-index: 1;

                            then just use margin to adjust it over top of the thumb.
                            i suggest putting both inside a div.

                            Comment

                            • fris
                              Too lazy to set a custom title
                              • Aug 2002
                              • 55679

                              #15
                              unless you are trying to do a hover effect, then best way it just to watermark it automatically.

                              here is an example of a play button on hover.

                              http://cssglobe.com/post/1238/style-your-image-links
                              Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

                              Comment

                              • Oracle Porn
                                Affiliate
                                • Oct 2002
                                • 24433

                                #16
                                Originally posted by fris
                                unless you are trying to do a hover effect, then best way it just to watermark it automatically.

                                here is an example of a play button on hover.

                                http://cssglobe.com/post/1238/style-your-image-links
                                looks like this will be the only thing that will work, what i was originally looking for is the inverted version of this script, to always show the play button and on hover make it disappear.


                                Comment

                                • mafia_man
                                  Confirmed User
                                  • Jul 2005
                                  • 1965

                                  #17
                                  Z-Index is the solution to what you are asking but it's not a good idea to watermark using CSS as people can still easily steal your photos.

                                  Imagemagick is a tool you can use to watermark images on-the-fly either during upload or delivery.
                                  I'm out.

                                  Comment

                                  • Oracle Porn
                                    Affiliate
                                    • Oct 2002
                                    • 24433

                                    #18
                                    z-index didn't seem to work cuz i cant edit actual html. the java posted above works, i need to invert it somehow.


                                    Comment

                                    • MetaMan
                                      I AM WEB 2.0
                                      • Jan 2003
                                      • 28682

                                      #19
                                      no z-index does work you just have no idea to explain your problem. we dont speak jew here.

                                      Comment

                                      • quantum-x
                                        Confirmed User
                                        • Feb 2002
                                        • 6863

                                        #20
                                        Originally posted by calmlikeabomb
                                        It's called using the z-index and it only works when elements have a set position type.

                                        Also, it's pointless and you should be using PHP or another language/software to create images with real water marks.
                                        You're an idiot.
                                        PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

                                        Comment

                                        • Mutt
                                          Too lazy to set a custom title
                                          • Sep 2002
                                          • 34431

                                          #21
                                          the problem with using the thumbnail as a background image is that it is unclickable no?

                                          i don't see the problem using CSS to add a watermark -look at all the TGP's that use CSS to add a little 'NEW' graphic on top of their thumbnails.
                                          I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!

                                          Comment

                                          • Oracle Porn
                                            Affiliate
                                            • Oct 2002
                                            • 24433

                                            #22
                                            Originally posted by MetaMan
                                            no z-index does work you just have no idea to explain your problem. we dont speak jew here.
                                            ofcourse z-index works, just not with this problem
                                            like i said i can not edit html itself only the css

                                            here is the html code
                                            Code:
                                            					
                                            <div class="img">
                                            <a   target='_blank'   href="http://www.link.com"><img src="thumb.jpg" width="240" height="180" id="thumbs4" name="thumbs4" alt="video" /></a>
                                            </div>


                                            Comment

                                            • Oracle Porn
                                              Affiliate
                                              • Oct 2002
                                              • 24433

                                              #23
                                              Originally posted by Mutt
                                              the problem with using the thumbnail as a background image is that it is unclickable no?

                                              i don't see the problem using CSS to add a watermark -look at all the TGP's that use CSS to add a little 'NEW' graphic on top of their thumbnails.
                                              since its just a background i guess the original thumb with a link under it should work


                                              Comment

                                              • JD
                                                Too lazy to set a custom title
                                                • Sep 2003
                                                • 22651

                                                #24
                                                not being able to edit the html sucks :/ why cant you edit it btw?

                                                Comment

                                                • Deej
                                                  I make pixels work
                                                  • Jun 2005
                                                  • 24386

                                                  #25
                                                  Originally posted by MetaMan
                                                  position: relative;
                                                  z-index: 0;

                                                  then for the overtop

                                                  position: relative;
                                                  z-index: 1;

                                                  then just use margin to adjust it over top of the thumb.
                                                  i suggest putting both inside a div.
                                                  Originally posted by MetaMan
                                                  no z-index does work you just have no idea to explain your problem. we dont speak jew here.
                                                  completely awesome and the new avatar is totally freakin me out

                                                  Deej's Designs n' What Not
                                                  Hit me up for Design, CSS & Photo Retouching


                                                  Icq#30096880

                                                  Comment

                                                  • Oracle Porn
                                                    Affiliate
                                                    • Oct 2002
                                                    • 24433

                                                    #26
                                                    thanks everyone for the help, i figured it out with the javascript fris posted


                                                    Comment

                                                    • bns666
                                                      Confirmed Fetishist
                                                      • Mar 2005
                                                      • 11554

                                                      #27
                                                      Originally posted by fris
                                                      unless you are trying to do a hover effect, then best way it just to watermark it automatically.

                                                      here is an example of a play button on hover.

                                                      http://cssglobe.com/post/1238/style-your-image-links
                                                      for this, read this post exactly when i needed it.
                                                      CAM SODASTRIPCHAT
                                                      CHATURBATEX LOVE CAM

                                                      Comment

                                                      • designerscode
                                                        Confirmed User
                                                        • Jan 2010
                                                        • 220

                                                        #28
                                                        Originally posted by mafia_man
                                                        Z-Index is the solution to what you are asking but it's not a good idea to watermark using CSS as people can still easily steal your photos.

                                                        Imagemagick is a tool you can use to watermark images on-the-fly either during upload or delivery.
                                                        This guy is right, you may be able to watermark but knowledgeable ones know how to steal from under your nose... and its spotless too haha

                                                        Mainstream & Adult Design Services
                                                        ICQ: 581772626 | shinobi [at] designerscode [dot] com

                                                        Comment

                                                        • TheDA
                                                          Confirmed User
                                                          • May 2006
                                                          • 4665

                                                          #29
                                                          Originally posted by designerscode
                                                          This guy is right, you may be able to watermark but knowledgeable ones know how to steal from under your nose... and its spotless too haha
                                                          You are also right but he's not watermarking to stop people from stealing his images
                                                          Sharleen Spiteri - 1989 - In The Ass

                                                          Comment

                                                          Working...