Continuing my epic battle with hotlinkers
Virtually all bloggers have to deal with it eventually. Virtually every website will eventually have to take some type of action. Some call it theft, and others call it ignorance. In reality it is a bit of both. After all, the web is supposed to be a free and open place. It’s supposed to be a place where information, ideas, and ideals are shared openly. That’s why many people don’t really give any thought to linking directly to images and other content on differing websites in order to display that content on another.
The concept is called “hotlinking,” and it is well known to almost every blogger and web developer. It’s not really a problem for most of us. For that matter, it isn’t too much of an issue for this blog. However, I was a bit bored so I decided to dust off my PHP skillz and see if I could get something that would reasonably benefit all parties concerned.
Goals:
- Allow linkers to retain the image.
- Display a “watermark” or marker of some kind on the image.
- Reduce the quality to conserve bandwidth.
- reduce processing cost as much as possible.
Basically, I created a few processing scripts that will allow people to view images in their high quality PNG format while on my blog. Everyone should see images in PNG format, like the one below, when surfing around far away no where blog.

When not on my blog, the images will (should) appear as below. They will have the address banners across the top and bottom with a reduced JPG quality. On average, reducing quality and increasing compression with the JPEG file format allows me to save about 80% on bandwidth that would normally go to hotlinkers.
Lastly, these down converted images are cached and served on subsequent requests. This saves me processing overhead, since I’m on a shared hosting plan.

None of this is really too complicated, or new. I managed to get a working model done in a little over two days of spare time. I’m still working out all the details and looking for bugs. I’ll share the code once I’m sure everything is working well enough.
My test confirm functionality in: IE , Firefox, Opera, ??
The purpose of this post is to get feedback about any problems visitors are experiencing. If you seem to be having a problem with viewing images, please leave a comment or email me using the contact item in the sidebar.
Thanks,
- j.valdez
I currently use about 3% of my allotted monthly bandwidth. I’ll do something like this once I hit 20%.
Yeah, it’s not much of a problem, yet. I just wanted to do it for the sake of doing it and also because I was noticing an increase in the hotlinking.
Also, I’ve essentially turned every hotlinked image on my site into free advertising, and you can’t really argue with that.
Tenma looks so cute in that picture =]
I can’t say I have any bandwidth issues either, but if hotlinkers are affecting page load times for my readers I’d definitely look into it. It’s a neat idea you have here though - the image is still displayed but saves bandwidth and shows its origin at the same time. Good work!
The trouble I have is that I sometimes store avatars for forums I visit on my own server, so I’m effectively hotlinking myself! Is your solution directory-specific so you can specify which image(s) are affected? I have to say I’m intrigued as to how you’ve achieved this…
@IcyStorm - Yeah, I’ve been wanting to use it for a while now. =)
@Martin - There are many solutions to the issue of allowing certain images to be “hotlinked” while restricting others. The way I have it setup now, it wouldn’t be too difficult to either add a filename check or simple cache a “good” image to be served when requested. Also, it would be possible to simple take the directory used to server images you personally use out of the scope of this restriction policy.
I also have some images I’d like to use without the down-conversion too.