a guest Aug 17th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # Create a base64 data URI from an image and copy it to clipboard.
- # Uses OpenSSL to create the base64 representation.
- the_mimetype=$(file -bN --mime-type "$1")
- the_content=$(openssl base64 < "$1" | tr -d '\n')
- # Use printf instead of echo to avoid the ending newline
- printf "data:$the_mimetype;base64,$the_content" | pbcopy
RAW Paste Data