Solved

copyright watermark with css

Posted on 2006-06-16
3
246 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
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…
The viewer will learn how to count occurrences of each item in an array.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now