2021-11-26 11:26:18 +00:00
|
|
|
#!/usr/bin/env python3
|
2019-08-19 21:00:28 +01:00
|
|
|
|
|
|
|
import glob
|
|
|
|
import ntpath
|
|
|
|
import subprocess
|
2019-12-05 17:07:57 +00:00
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
|
|
|
|
files = list()
|
|
|
|
if len(sys.argv) == 1:
|
|
|
|
files = [f for f in glob.glob("./**/*.svg", recursive=True)]
|
|
|
|
else:
|
|
|
|
for f in sys.argv:
|
|
|
|
if os.path.exists("./svg/"+f+".svg"):
|
|
|
|
files.append("./svg/"+f+".svg")
|
2019-08-19 21:00:28 +01:00
|
|
|
|
|
|
|
sizes = [16, 32, 64, 128, 256, 512, 1024, 4096]
|
|
|
|
|
|
|
|
for f in files:
|
|
|
|
name = ntpath.basename(f).replace(".svg", "")
|
|
|
|
for s in sizes:
|
2021-11-26 11:30:25 +00:00
|
|
|
#subprocess.run(["inkscape", "-z", "-C", "-w", str(s), "-e", "./png/fixed_width/"+str(s)+"/"+name+".png", "-f", f])
|
|
|
|
#subprocess.run(["inkscape", "-z", "-C", "-h", str(s), "-e", "./png/fixed_height/"+str(s)+"/"+name+".png", "-f", f])
|
2020-04-21 20:07:08 +01:00
|
|
|
subprocess.run(["inkscape", f, "-C", "-w", str(s), "--export-filename=./png/fixed_width/"+str(s)+"/"+name+".png"])
|
|
|
|
subprocess.run(["inkscape", f, "-C", "-h", str(s), "--export-filename=./png/fixed_height/"+str(s)+"/"+name+".png"])
|