summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-01-08 21:02:38 +0100
committerJules Laplace <julescarbon@gmail.com>2019-01-08 21:02:38 +0100
commit7645bacfec1919d7bcb3821bc03dcfa94e1bf46f (patch)
tree4f869c4dd66802615879c9f6b5707aef9828d590
parent64f025a818e18707aaa71e7bae9144827bb7f319 (diff)
thirds
-rw-r--r--crop-thirds.py12
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: