junglejourney
changeset 214:e46ec73973f1
Added a simple tool to generate PNG previews of pages.
| author | David Boddie <david@boddie.org.uk> |
|---|---|
| date | Sat Oct 15 20:52:19 2011 +0200 |
| parents | 1a36fae229c2 |
| children | 3ae571b43ba0 |
| files | materials/svg2png_previews.py |
| diffstat | 1 files changed, 22 insertions(+), 0 deletions(-) [+] |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/materials/svg2png_previews.py Sat Oct 15 20:52:19 2011 +0200 1.3 @@ -0,0 +1,22 @@ 1.4 +#!/usr/bin/env python 1.5 + 1.6 +import os, sys 1.7 + 1.8 +if __name__ == "__main__": 1.9 + 1.10 + if not 1 <= len(sys.argv) <= 2: 1.11 + 1.12 + sys.stderr.write("Usage: %s [resolution in dpi]\n" % sys.argv[0]) 1.13 + sys.exit(1) 1.14 + 1.15 + elif len(sys.argv) == 2: 1.16 + resolution = int(sys.argv[1]) 1.17 + else: 1.18 + resolution = 144 1.19 + 1.20 + for i in range(4): 1.21 + os.system("inkscape -e png/page-%i.png -d %i -y 255 svg/page-%i.svg" % (i, resolution, i)) 1.22 + 1.23 + os.system("inkscape -e png/cover.png -d %i -y 255 cover.svg" % resolution) 1.24 + 1.25 + sys.exit()
