From 7645bacfec1919d7bcb3821bc03dcfa94e1bf46f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 8 Jan 2019 21:02:38 +0100 Subject: thirds --- crop-thirds.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crop-thirds.py b/crop-thirds.py index c189b74..ebb9f48 100644 --- a/crop-thirds.py +++ b/crop-thirds.py @@ -34,17 +34,15 @@ dst_width = int(src_width / opt.count) dst_height = int(dst_width / opt.aspect) dst_size = (dst_width, dst_height,) -offsets = [] -letters = [] +crops = [] +paths = [] for i in range(opt.count): - offsets.append(int(i / opt.count * dst_width)) - letters.append(chr(97 + i)) + x = int(i / opt.count * dst_width) + crops.append((x, y0, x + dst_width, y0 + dst_height,)) + paths.append(os.path.join(opt.out_dir, opt.label, chr(97 + i))) y0 = opt.vertical_offset - dst_height / 2 -crops = [(x, y0, x + dst_width, y0 + dst_height,) for x in offsets] -labels = [opt.label + '_' + letter for letter in letters] -paths = [os.path.join(opt.out_dir, label) for label in labels] for path in paths: if opt.clobber: -- cgit v1.2.3-70-g09d2