Solved

copyright watermark with css

Posted on 2006-06-16
3
249 Views
Last Modified: 2013-11-19
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
Comment
Question by:jgnunn
3 Comments
 
LVL 18

Expert Comment

by:Morcalavin
ID: 16922514
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
 
LVL 1

Author Comment

by:jgnunn
ID: 16922600
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
 
LVL 11

Accepted Solution

by:
mvan01 earned 500 total points
ID: 16922975
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question