Skip to content

Instantly share code, notes, and snippets.

@alotaiba
Created April 11, 2011 10:01
Show Gist options
  • Save alotaiba/913308 to your computer and use it in GitHub Desktop.
Save alotaiba/913308 to your computer and use it in GitHub Desktop.
How to encode images to base64 for HTML using openssl
# Credit goes to Marcel http://narings.net/blog/archives/4
echo "<img src=\"data:image/png;base64,`openssl base64 -in img.png | tr -d '\n\'`\">" > page.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment