Last active
January 17, 2021 18:03
-
-
Save DouglasdeMoura/2aede477cffcf4d197c90e3f3efec277 to your computer and use it in GitHub Desktop.
Converting image to base64 on Linux
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
bash { echo "data:image/png;base64,"; openssl enc -base64 -in src/pages/Index/images/input.png; } > output.b64 | |
# Remove new lines | |
echo (tr -d "\n\r" < output.b64) >> output_without_new_lines.b64 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment