back to krasimirtsonev.com
to blog's home page

How to import images directly into the html code (base64)

A couple of months ago I received an interesting task - to create a small html application for iPhone. To be honest, for me that meant creating a small site with a specific size. Of course I was wrong. Together with couple of small bugs I had to deal with one other requirement - everything had to be in one html file. It was clear how to add the javascript and the css, but what about the images.

The solution was to use base64 encoding. I wrote a small php script that accepts an image and shows me the equivalent in base64 string.

Just browse your image and click "Submit Query".

P.S.
base64 doesn't work in IE
Sharing ...
Commenting ...
blog comments powered by Disqus