| 1 | #!/usr/bin/python |
| 2 | import os,sys,string |
| 3 | for i in sys.argv[1:]: |
| 4 | j = string.find(i,'.') |
| 5 | o = i[:j] + '.png' |
| 6 | print "converting %s to %s " % (i, o) |
| 7 | text="""pstoimg -type png -crop abls -white -quiet -out _tmp_x.png %s |
| 8 | pngtopnm _tmp_x.png > _tmp_x.pnm |
| 9 | pnmrotate -90 _tmp_x.pnm > _tmp_y.pnm |
| 10 | pnmtopng _tmp_y.pnm > %s |
| 11 | rm -f _tmp_* |
| 12 | """ % (i, o) |
| 13 | os.system(text) |