#!/bin/sh

for i in $*; do
    name=`echo ${i%%.png}|sed s,-,_,g`
    echo "static const char *$name = "
    cat "$i" | perl -pi -e 's/(.)/"\\x".unpack("H2", $1)/ges; s/(.{1,40})/"$1"\n/g'
    echo ";"
    echo "static int ${name}_size = " `ls -l "$i" | awk '{print $5}'` ";"
done
