summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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')))):