• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

copyright watermark with css

HI. I am tryin to do this:




output an img (no width/height attributes available), then somehow over the top of the image, add a layer that is has part transparent text stating 'copyrighted'. but the layer must adjust itself to the size of whatever image is outputted. anyone any ideas?
0
jgnunn
Asked:
jgnunn
1 Solution
 
MorcalavinCommented:
I don't believe such a thing is possible with javascript.  You would have to use perl/php/ruby etc and use their image manipulation modules/function to modify the image.
It may be possible to "simulate"  a watermark on the image using javascript, but if the user saved the image or direct linked to it, the watermark wouldnot be present.
0
 
jgnunnAuthor Commented:
sorry, i thought id posted this in the css section...

..image couldnt be right clicked copied if its in the background=, i know theres other ways for them to get the image, but im just tryin to make it 'not easy'.

I can do it with a <table background= , then insert a transparent.gif in the <td> , but i need the width and height attribs of the img for it work, so am looking for another alt..
0
 
mvan01Commented:
Maybe you did post in the proper section afterall then ...

Javascript can be used to get the attributes of the image, which you said you need for the <table background= method.  I'll admit I don't know how reliable the function is in JS, as I've seen it fail for me in the past.

Would a method like this help?

<script>
var myImage = new Image();
myImage.src = 'http://www.experts-exchange.com/images/expertAwards2006Button.gif';
var theWidth = myImage.width;
var theHeight = myImage.height;
</script>

... all done without displaying the image, and therefore can be done before displaying the image, or rendering the page, if necessary.

Peace and joy.  mvan
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now