8 text2img-dataurl - Convert text input to image in "data:..." URL representation
16 msgprefix
="$1" perl
-pe '$s += length $_; END { 1 while $s =~ s/(\d)(\d\d\d)(( \d\d\d)*)$/\1 \2\3/; print STDERR "$ENV{msgprefix}$s bytes\n"; }'
19 input
=`cat | report_size 'input size: '`
20 echo -n 'data:image/png;base64,'
21 convert
-background none
-font /usr
/share
/fonts
/truetype
/freefont
/FreeSans.ttf
"$@" label
:"$input" png
:- |\
22 report_size
'image size: ' | base64 |
tr -d "\n" |\
23 report_size
'base64 size: '