Enlarge default image generation sizes.

This commit is contained in:
Revar Desmera 2019-08-01 19:45:46 -07:00
parent 6c98bf1afc
commit c148317afb

View file

@ -145,14 +145,12 @@ class ImageProcessing(object):
with open(scriptfile, "w") as f: with open(scriptfile, "w") as f:
f.write(script) f.write(script)
if "Med" in extype: if "Big" in extype:
imgsizes = ["800,600", "400x300"] imgsize = [640, 480]
elif "Big" in extype: elif "Med" in extype or "distribute" in script or "show_anchors" in script:
imgsizes = ["1280,960", "640x480"] imgsize = [480, 360]
elif "distribute" in script or "show_anchors" in script:
imgsizes = ["800,600", "400x300"]
else: # Small else: # Small
imgsizes = ["480,360", "240x180"] imgsize = [320, 240]
tmpimgs = [] tmpimgs = []
if "Spin" in extype: if "Spin" in extype:
@ -167,7 +165,7 @@ class ImageProcessing(object):
scadcmd = [ scadcmd = [
OPENSCAD, OPENSCAD,
"-o", tmpimgfile, "-o", tmpimgfile,
"--imgsize={}".format(imgsizes[0]), "--imgsize={},{}".format(imgsize[0]*2, imgsize[1]*2),
"--hardwarnings", "--hardwarnings",
"--projection=o", "--projection=o",
"--autocenter", "--autocenter",
@ -199,7 +197,7 @@ class ImageProcessing(object):
scadcmd = [ scadcmd = [
OPENSCAD, OPENSCAD,
"-o", tmpimgfile, "-o", tmpimgfile,
"--imgsize={}".format(imgsizes[0]), "--imgsize={},{}".format(imgsize[0]*2, imgsize[1]*2),
"--hardwarnings", "--hardwarnings",
"--projection=o", "--projection=o",
"--autocenter", "--autocenter",
@ -240,7 +238,12 @@ class ImageProcessing(object):
os.unlink(scriptfile) os.unlink(scriptfile)
if len(tmpimgs) == 1: if len(tmpimgs) == 1:
cnvcmd = [CONVERT, tmpimgfile, "-resize", imgsizes[1], newimgfile] cnvcmd = [
CONVERT,
tmpimgfile,
"-resize", "{}x{}".format(imgsize[0], imgsize[1]),
newimgfile
]
res = subprocess.call(cnvcmd) res = subprocess.call(cnvcmd)
if res != 0: if res != 0:
sys.exit(-1) sys.exit(-1)
@ -251,7 +254,7 @@ class ImageProcessing(object):
"-delay", "25", "-delay", "25",
"-loop", "0", "-loop", "0",
"-coalesce", "-coalesce",
"-scale", imgsizes[1], "-scale", "{}x{}".format(imgsize[0], imgsize[1]),
"-fuzz", "2%", "-fuzz", "2%",
"+dither", "+dither",
"-layers", "Optimize", "-layers", "Optimize",