cleanup
This commit is contained in:
parent
ceabbed29f
commit
5baabca5c8
3 changed files with 16 additions and 14 deletions
|
|
@ -28,17 +28,11 @@ if __name__ == '__main__':
|
|||
|
||||
f, fname = tempfile.mkstemp(suffix='.png')
|
||||
cmd = ['oxframe', '-i', opts.input, '-o', fname, '-p', opts.pos]
|
||||
p = subprocess.Popen(cmd + ['-x', opts.size, ])
|
||||
p = subprocess.Popen(cmd)
|
||||
p.wait()
|
||||
frame = Image.open(fname)
|
||||
width = frame.size[0]
|
||||
height = frame.size[1]
|
||||
if height > width:
|
||||
p = subprocess.Popen(cmd + ['-y', opts.size, ])
|
||||
p.wait()
|
||||
frame = Image.open(fname)
|
||||
width = frame.size[0]
|
||||
height = frame.size[1]
|
||||
|
||||
if opts.size:
|
||||
size = opts.size
|
||||
|
|
@ -64,3 +58,4 @@ if __name__ == '__main__':
|
|||
frame.save(opts.output)
|
||||
if os.path.exists(fname):
|
||||
os.unlink(fname)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue