summaryrefslogtreecommitdiff
path: root/crop-thirds.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-01-08 21:04:03 +0100
committerJules Laplace <julescarbon@gmail.com>2019-01-08 21:04:03 +0100
commit0651be97f1321e9b18d1ac0514d1902cc1a8d96e (patch)
tree1ba23bff6a3c0eefe803548efbf80be4f08df0f8 /crop-thirds.py
parent7645bacfec1919d7bcb3821bc03dcfa94e1bf46f (diff)
thirds
Diffstat (limited to 'crop-thirds.py')
-rw-r--r--crop-thirds.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/crop-thirds.py b/crop-thirds.py
index ebb9f48..7dd23e8 100644
--- a/crop-thirds.py
+++ b/crop-thirds.py
@@ -33,6 +33,7 @@ src_height = 512
dst_width = int(src_width / opt.count)
dst_height = int(dst_width / opt.aspect)
dst_size = (dst_width, dst_height,)
+y0 = opt.vertical_offset - dst_height / 2
crops = []
paths = []
@@ -40,15 +41,12 @@ paths = []
for i in range(opt.count):
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
-
-for path in paths:
+ path = os.path.join(opt.out_dir, opt.label, chr(97 + i))
if opt.clobber:
if os.path.exists(path):
rmtree(path)
os.makedirs(path)
+ paths.append(path)
dataset = []
for i, fn in enumerate(sorted(glob.glob(os.path.join(opt.folder, '*.png')))):