ugly base64 version check

This commit is contained in:
Giovanni Angoli
2016-03-25 17:48:51 +01:00
parent 8fa451af9a
commit 0c1ec84973

View File

@@ -38,7 +38,11 @@
imagefile="$1"
fullname="$2"
imgdata=$(convert "${imagefile}" -resize '40x40!' - | base64 -w 0)
base64switch=""
base64check=$(echo "jj" | base64 -w 0 > /dev/null 2>&1)
[ "$?" -eq "0" ] && base64switch="-w 0"
imgdata=$(convert "${imagefile}" -resize '40x40!' - | base64 $base64switch)
cat <<EndOfFile
{"_type":"card","name":"${fullname}","face":"${imgdata}"}
EndOfFile