an All Creative World site
Ivan's picture

Don't hotlink, ImgRed instead

Hotlinking is when you use the image from one website on another website without copying the image to the second website's server.

Most website operators hate when people do that to their images if they don't link back to the source. Bandwidth costs money and if you're using someone's bandwidth to have the image appear for your content it's like stealing money.

You can of course avoid all this problem by saving the image and uploading it to your own server. Do this only if the image is not copyrighted of course. But, this is a bit of a hassle that you may be willing to do if it's your blog.

However if you just want to use an image for a forum post, it's a bit too much trouble to download and upload the image. There is ImageWell of course to help you, but there is an even simpler way.

You can use the service called ImgRed. All you do is add http://imgred.com/ in front of the url of the image you want to display and ImgRed will take the image (once) and create a copy of it on ImgRed's servers. You are saving time because you don't need to go though the hassle of hosting the image yourself and at the same time you're being a good person by avoiding hotlinking.

Here is a test. First I'm going to hotlink an image with this code from Ads of the World. The owner of the site will not be happy! ;)

img src="http://adsoftheworld.com/files/images/CalciWWF.preview.jpg"

Second, I'm ImgRed-ing the same image with the following code. Notice the extra piece of ImgRed code:

img src="http://imgred.com/http://adsoftheworld.com/files/images/CalciWWF.preview.jpg"

You can see that the two images are identical, but they are hosted on two different servers. The first one puts a burden on Ads of the World servers. The second one loads from ImgRed's servers.

And we are not done. You can even generate a thumbnail directly through ImgRed by adding http://imgred.com/tn/ in front of the image url. You can use this thumbnail to link back to the original story if the image is too big to display within a forum topic.

Here is an example:

Commenting on this Blog entry is closed.

JimD's picture
2626 pencils

Thanks so much for this. This has been something that has bugged me for a long time. Very cool info!

-----------
Visit Creative Guy for graphics and Mac OS tips, tricks, tutorials and commentary

-----------
Visit The Graphic Mac for graphics and Mac OS tips, reviews, tutorials and discussion.

ttaylor's picture
78 pencils

Wow that's awesome! I've had a few of my images being used in the past where I noticed large spikes for one image. Pretty annoying. Great tip Ivan.

FCro's picture
1 pencil

As useful as this is for some surfers, it's the Napster of digital imagery, imploring people to republish images without caring who owns the rights to them. ( Personally, I'd rather give up some bandwidth than having my images collecting on a third-party server I know nothing about. )

For anyone else who's concerned, I've written up opt-out instructions for ImgRed.

Ivan's picture

Thanks for the info on opt-out.

colin's picture
5 pencils

I took a look at imgred's website. Basically, he's using a PHP script to grab the requested image, store it locally, and serve the local copy.

Unless his hosting plan and server is way better than yours, this doesn't seem to be a real "solution" to the problem. You're just moving the traffic from one server to another one (?) server.

(I'm also going to ignore the fact that his script is not very efficient, especially with the database code he's using.)

You can use the Coral Cache to do something similar, but their network is very robust. Rewrite your images as:

http://YOURHOSTNAME.COM.nyud.net:8080/PATH/TO/YOUR/FILE

Ivan's picture

How can you tell what code is he using?

markbowen's picture
20 pencils

If you go to http://imgred.com and then click on the 'source code available' link at the top of the page then you can get the php code he is using there.

dbirdz's picture
6 pencils

I've written a post to my blog with some information that could go as comment in here:

"I guess this was not the complete idea of the creator of imgred.com. It was rather to provide others with an easy-to-use showcase solution which everyone can adopt for their own server.

Unfortunately, the code is not ready for any server: if you don't have permission to run the PHP exec command on your host, which is very likely if you don't have a pro account, the script will fail. A very simple solution to this problem is to replace the user defined function GetMIMEType by the PHP function mime_content_type."

see full post: http://www.level0.ch/mt/2007/07/setting_up_imgred.html

Creativebits is a blog about Creativity, Graphic Design, Adobe, Apple and other related subjects.

Do you need a great new logo?

Pick a pre-made design from a collection of 50,000+ logos that will be customized to your business name for free.