- How do I keep people from saving my images?
- How can I hide my source code?
- How do I add an icon to the addressbar for my site?
How do I keep people from saving my images?
Images placed on the Internet are available for all to download. There is no way to display your image in the browser, yet keep people from saving them. If your images are that important, don't place them on the Internet! There seems to be a general confusion that a no right click script will protect images from being saved. This is untrue. Here are some of the methods one could use to save images from the Web:
- Right click, Save As
- Save the entire web page with File, Save As
- Get the images out of the Temporary Internet Files directory
- Use a screen capture program, or the Print Screen button
What do you do? Your best bet would be to add a watermark to the image. A watermark is a semi-transparent bit of text that you overlay your image with, to show that it is yours. Generally, it is added to a lower corner of your image. This will allow viewers of the image to see that it is your image.
How can I hide my source code?
It is virtually impossible to make your source code unassailable. Nearly every method suggested to encrpyt, obfuscate or make your source code invisible can be broken by an experienced user, and many methods cause problems for normal users, making your site appear much less professional and encouraging them to go elsewhere. Ask yourself: is my source code really that important?
To illustate, here are some of the main methods used for hiding source code, and their disadvantages:
- Show pages through a complicated network of chromeless windows, framesets, etc. Again, this can relatively easily be cracked, but the numerous browser/version differences mean it limits who can use your site and causes serious accessibility issues.
No doubt other methods of hiding source code are available, but they almost always mean your page is in violation of accessibility recommendations, and doing that on a commercial site could be construed as illegal and US and UK law (the Americans With Disabilites Act and the Disability Discrimination Act respectively). It really isn't worth the hassle.
How do I add an icon to the addressbar for my site?
This icon is known as a "favicon" and displays in the addressbar, and in some browsers the favorites/bookmarks list as well. To add one to to your page, use something like the snippet below in the <head> tag, replacing the URL with the address of your icon.
Note that you must use an ICO (icon) file, created in a decent image editor, as an ICO is in fact two images - 16x16 and 32x32 pixels. For more information on favicons, check out http://www.favicon.com/.