This commit is contained in:
j 2010-04-23 21:47:26 +03:00
commit 5baabca5c8
3 changed files with 16 additions and 14 deletions

View file

@ -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)