diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-01-08 21:02:38 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-01-08 21:02:38 +0100 |
| commit | 7645bacfec1919d7bcb3821bc03dcfa94e1bf46f (patch) | |
| tree | 4f869c4dd66802615879c9f6b5707aef9828d590 /crop-thirds.py | |
| parent | 64f025a818e18707aaa71e7bae9144827bb7f319 (diff) | |
thirds
Diffstat (limited to 'crop-thirds.py')
| -rw-r--r-- | crop-thirds.py | 12 |
1 files 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: |
