Last active
August 29, 2015 14:04
-
-
Save dzsodzso63/58fa488d11fa04ce0650 to your computer and use it in GitHub Desktop.
How to create asset string from a png file
This file contains 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
DATAURIPREFIX="data:image/png;base64," | |
TINYPNG_API_KEY=[register for one in https://tinypng.com] | |
api_loc=`curl -i --user api:$TINYPNG_API_KEY --data-binary @$1 https://api.tinypng.com/shrink | grep "Location:" | cut -f 2 -d " "` | |
echo -n $DATAURIPREFIX; curl -s $api_loc | base64 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment