Embedding an image in a URL
The up and coming Hackszine, by the people that brought us Makezine, and Craftzine, has a cool (old-ish) post about embedding image data into a URI, using the “data:” URI. This actually works for any data (image, text, xml, etc) but the most fun thing to me is using it for images.
The URI string could get very large very fast, however, so the converter limits you to 51200 bytes. It also takes a little finagling once the converter spits it out, as you have to take out the single-quotes, tabs, plus signs, and carriage returns. This is done pretty easily with a RegExp search-and-replace for: ‘*’ (replacing it with nothing). once you do that, you have to strip off some bits from the beginning and end, so it looks like this: Me.
Fun stuff!
Tags: interesting, web design



rps 1:33 pm on 2/5/2007 Permalink
Quite cool. Not sure I’ll make use of it, but quite cool :-)