I have faced an interesting thing as… if I use this code to download image as a string for Base64 encoded byte array it works fine
data:image/png;base64,<String>
But I was tring to encode the same image to Base32 and call it as
data:image/png;base32,<String>
But that way doesn’t work. Maybe I am using some wrong protocol or something… 🙁
So my question is…
How to call Base32 image for img tag?
Thanks
If you mean the browser isn’t displaying the image, all it means is that the browser doesn’t support base32. I have the same issue with Iceweasel4, Firefox 3, and Chrome 12. IE7 doesn’t show either base64 or base32-encoded inline images.
Here are the files I’m using for test, stolen from http://www.sweeting.org/mark/blog/2005/07/12/base64-encoded-images-embedded-in-html:
test1.html shows fine in Firefox, Iceweasel, Chrome:
test2.html doesn’t show in any browser I have.
I used b64decode and b32encode from Python’s base64 module to create the base32-encoded image from the base64-encoded image.
According to https://www.rfc-editor.org/rfc/rfc2397, the formats supported are base64 and plain ASCII (for those characters outside the range of printable 7-bit characters, you use the standard %XX hex-encoding.)
IE apparently doesn’t support any in-line images until IE8.