Designer News is where the design community meets.
over 7 years ago from David M, UI Developer
This is one of my favorites. It is a bash function that will Base64 encode any image and copy it to the clipboard:
function base() { base64 -o ~/Desktop/base64.txt -i "$@" pbcopy < ~/Desktop/base64.txt rm -Rf ~/Desktop/base64.txt }
To run the command do this: base ~/path/to/file.jpg. Will Base64 encode JPG, PNG, and SVG.
base ~/path/to/file.jpg
Surely you could just use this?
function base() { base64 -i "$@" | pbcopy }
LOL. Probably. Good call.
Now playing
This is one of my favorites. It is a bash function that will Base64 encode any image and copy it to the clipboard:
function base() { base64 -o ~/Desktop/base64.txt -i "$@" pbcopy < ~/Desktop/base64.txt rm -Rf ~/Desktop/base64.txt }
To run the command do this:
base ~/path/to/file.jpg
. Will Base64 encode JPG, PNG, and SVG.