I will start this blog right off (I don’t like introductions) with a trick I found while reading thedailywtf.com.
The problem: you are posting something on the internet and you want to link or embed an image but the site you are posting to doesn’t host the images.
Obvious solution: use an image host (imgur, flickr, whatever floats your boat).
The trick (but not really a solution): encode the image into base64, give it to an URL shortener site like TinyURL and use the result in your post.
How it works:
<html> <body> <img src="data:image/jpeg;base64,/9j/4AAQSkZJ...RXGEXSIgEsVs7wfwtXKkkseb90q04mRuO0eIkkkmak2Ps//9k=" /> <br /> <img src="http://tinyurl.com/nzpmgsm" /> <br /> </body> </html>
There is a standard feature of the HTML format which allows for embedding images (or any file for that matter) directly into the src field as you can see in the first <img>.
The second <img> has the URL which TinyURL gave me for the shortened data above. The results can be seen in the demo page.
As far as I know this trick works on all browsers (if they’re up to date) but most shorteners employ a limit to the length of the URL you can shorten (duh). I actually got banned briefly by TinyURL while attempting to test said limit. The result is you can probably get away with a 10k URL which means about 7.5k for the image data (base64 adds 1/3 overhead).
Disclaimer: I’m not advocating the use of this trick since it puts unnecessary work on URL shorteners which usually provide the service free of charge.
Disclaimer 2: I did not come up with this trick, someone used it while posting a story on thedailywtf.com. I couldn’t find the story because it was unrelated to the trick and I don’t remember other details.