6 base
= os
.path
.splitext (os
.path
.split (sys
.argv
[1])[1])[0]
7 input = os
.path
.abspath (sys
.argv
[1])
8 output
= os
.path
.abspath (sys
.argv
[2])
9 program_name
= os
.path
.split (sys
.argv
[0])[1]
11 dir = tempfile
.mktemp (program_name
)
21 for sz
in [48,32,16] :
24 out
= '%(base)s-%(sz)d-%(depth)d.png' % locals()
25 system ('convert -depth %(depth)d -sample %(sz)d %(input)s %(out)s' %
29 system('icotool --output %s --create %s' % (output
, ' '.join (outputs
)))
30 system('rm -rf %(dir)s' % locals())