![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Affiliate
Industry Role:
Join Date: Oct 2002
Location: Icq: 94-399-723
Posts: 24,433
|
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; ![]() thanks |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Aug 2009
Location: me at smellynose.com
Posts: 206
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
I’m still alive barley.
Industry Role:
Join Date: Oct 2001
Location: Va
Posts: 10,060
|
Yea what grump said!
![]()
__________________
![]() ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
<div style="background: url(yourimage.png) top left no-repeat;"><img src="watermark.png" /></div>
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Aug 2009
Location: me at smellynose.com
Posts: 206
|
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 Code:
for file in `ls images/*.jpg`; do composite -gravity southeast -dissolve 15 watermark.jpg $file watermarked/$file; done |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Affiliate
Industry Role:
Join Date: Oct 2002
Location: Icq: 94-399-723
Posts: 24,433
|
shit that would be impossible
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Affiliate
Industry Role:
Join Date: Oct 2002
Location: Icq: 94-399-723
Posts: 24,433
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Industry Role:
Join Date: Aug 2009
Location: me at smellynose.com
Posts: 206
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Industry Role:
Join Date: Aug 2009
Location: me at smellynose.com
Posts: 206
|
Ahhhh. If that's the case then the background-image being the actual thumb is best. Why can't you do that?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Join Date: May 2004
Location: SW Palm Bay, Florida
Posts: 1,323
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 | |
Affiliate
Industry Role:
Join Date: Oct 2002
Location: Icq: 94-399-723
Posts: 24,433
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
Confirmed User
Industry Role:
Join Date: Aug 2009
Location: me at smellynose.com
Posts: 206
|
Quote:
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=''> ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
I AM WEB 2.0
Industry Role:
Join Date: Jan 2003
Posts: 28,682
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,372
|
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. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
Affiliate
Industry Role:
Join Date: Oct 2002
Location: Icq: 94-399-723
Posts: 24,433
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Industry Role:
Join Date: Jul 2005
Location: icq#: 639544261
Posts: 1,965
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
Affiliate
Industry Role:
Join Date: Oct 2002
Location: Icq: 94-399-723
Posts: 24,433
|
z-index didn't seem to work cuz i cant edit actual html. the java posted above works, i need to invert it somehow.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
I AM WEB 2.0
Industry Role:
Join Date: Jan 2003
Posts: 28,682
|
no z-index does work you just have no idea to explain your problem. we dont speak jew here.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
You're an idiot.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2002
Posts: 34,431
|
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!
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 | |
Affiliate
Industry Role:
Join Date: Oct 2002
Location: Icq: 94-399-723
Posts: 24,433
|
Quote:
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> |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 |
Affiliate
Industry Role:
Join Date: Oct 2002
Location: Icq: 94-399-723
Posts: 24,433
|
since its just a background i guess the original thumb with a link under it should work
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 |
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2003
Posts: 22,651
|
not being able to edit the html sucks :/ why cant you edit it btw?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 | |
I make pixels work
Industry Role:
Join Date: Jun 2005
Location: I live here...
Posts: 24,386
|
Quote:
__________________
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 |
Affiliate
Industry Role:
Join Date: Oct 2002
Location: Icq: 94-399-723
Posts: 24,433
|
thanks everyone for the help, i figured it out with the javascript fris posted
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#27 | |
Confirmed Fetishist
Industry Role:
Join Date: Mar 2005
Location: Fetishland
Posts: 11,526
|
Quote:
![]() ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#28 |
Confirmed User
Join Date: Jan 2010
Location: Shinobi here!
Posts: 220
|
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
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#29 |
Confirmed User
Industry Role:
Join Date: May 2006
Posts: 4,665
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |