-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartFileDrawer.py
51 lines (42 loc) · 1.13 KB
/
startFileDrawer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
__author__ = 'bison'
import sys
import core
inputFile = 'walk-dark-light-5.jpg'
outputFile = 'createdImages/tmp.png'
imageX = 255
imageY = 255
pixelSize = 10
fileType = 'png'
dpi = -1
modes = []
for arg in sys.argv:
if arg == '--help' or arg == '-h':
f = open('README.md')
print(f.read())
f.close()
sys.exit()
elif arg.startswith('if='):
inputFile = arg.replace('if=', '')
elif arg.startswith('of='):
outputFile = arg.replace('of=', '')
elif arg.startswith('imageX='):
imageX = int(arg.replace('imageX=', ''))
elif arg.startswith('imageY='):
imageY = int(arg.replace('imageY=', ''))
elif arg.startswith('pixelSize='):
pixelSize = int(arg.replace('pixelSize=', ''))
elif arg.startswith('dpi='):
dpi = int(arg.replace('dpi=', ''))
elif arg.startswith('mode='):
modes.append(arg.replace('mode=', ''))
elif arg.startswith('fileType='):
fileType = arg.replace('fileType=', '')
coreWorker = core.core(imageX, imageY, pixelSize, fileType, dpi)
coreWorker.fromFile(inputFile)
for mode in modes:
pass
coreWorker.saveImage(outputFile)
if 'glitch' in modes:
import glitch
gl = glitch.glitch()
gl.glitchFile(outputFile)