1
gruessle
THE BEST THING SINCE BUBBLE WRAP
  • 2004/6/1 18:11

  • gruessle

  • Friend of XOOPS

  • Posts: 348

  • Since: 2003/9/20


I just installed this on my site and it works great.
The only thing I don't like is that it watermarks images on my site as well.

It watermarks the thumbs as well if someone could modify this script to where it checks if there is a second dot (.) in the filename and then skips those that would be great.
Even better would be if it checks where the request comes from and if it comes from localhost then to skip the watermark else add the watermark.

Any help with that would be appreciated

Thanx
Gruessle


On the Internet, people steal stuff. Theft of HTML source code is a nuisance, sure, but the lifting of images is more common. Someone likes a logo on your page, or an e-book cover, or a picture of a physical product you're selling, and it becomes theirs to use.

A practical way to keep this from happening is to add a watermark to all your images, which is your logo or name on a corner somewhere, forcing anyone who takes your graphic to either unwillingly give you credit, or chop off a part of that picture.

Lucky for us, PHP has a set of functions to handle images, and in version 4.3 and above, it's included by default. Wrappers come in handy here because you might have an entire site full of images and would rather not spend three weeks watermarking tons of images by hand. Maybe you just don't want to have to juggle two sets of images, one watermarked and one normal.

Download this script from:http://www.jumpx.com/tutorials/wrapper/watermark.zip

The only files you need to worry about in that zip are htaccess.txt and wrapper.php. Upload them to a folder called "watermark", chmod htaccess.txt to 0755 and rename to ".htaccess".

The file wrapper.php remain as is. I've put comments in the file regarding most of what it does, so if you're curious go ahead and take a peek.

What the script does is this: It figures out the original image that was supposed to be called. Then it loads the watermark, which I've set in wrapper.php to be "watermark.png" which is just a PNG image containing the text "THIS IS WATER MARKED". The watermark is placed on top of the original, in the lower right corner, and output in the same format (i.e., JPEG) as the original.

You can tell the difference by looking at these two images:

http://www.jumpx.com/tutorials/wrapper/thomas.jpg

http://www.jumpx.com/tutorials/wrapper/thomas-watermarked.jpg

I've included several types of images (GIFs, JPGs, and PNGs) in the zip file for you to test out. Once you've got everything setup, upload those images and see how they look with the watermark.

This script will work with GIFs, JPEGs, and PNGs. Due to a patent issue (which expires worldwide in July 2004) GIFs can only be read, and not output. To make up for this, any of your GIFs will be output as PNGs, which should still work.

Login

Who's Online

221 user(s) are online (156 user(s) are browsing Support Forums)


Members: 0


Guests: 221


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits