Layout nitpicks for notime fragment option.
[lilypond.git] / buildscripts / genicon.py
blob543735240fea9542c7931c4a99dd978e85b8fa63
1 #!@PYTHON@
2 import os
3 import sys
4 import tempfile
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)
12 os.mkdir (dir, 0777)
13 os.chdir(dir)
15 def system (c):
16 print c
17 if os.system (c):
18 raise 'barf'
20 outputs = []
21 for sz in [48,32,16] :
23 for depth in [24,8]:
24 out = '%(base)s-%(sz)d-%(depth)d.png' % locals()
25 system ('convert -depth %(depth)d -sample %(sz)d %(input)s %(out)s' %
26 locals ())
27 outputs.append (out)
29 system('icotool --output %s --create %s' % (output, ' '.join (outputs)))
30 system('rm -rf %(dir)s' % locals())