Created
October 30, 2018 10:11
-
-
Save tiger8888/71f564cfab63051199f86f744e5f4138 to your computer and use it in GitHub Desktop.
Encode images (.png, .jpg, .gif) to base64 format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# R0lGOD image/gif | |
# /9j/4 image/jpeg | |
# JVBERi0xLj application/pdf | |
# PCFET0NUWVBFI text/html | |
echo "data:image/png;base64," > $1.b64 && "base64" $1 >> $1.b64 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment