From ecf02a143a8fdb8a3f0cf99a23a82e115819a396 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 7 Nov 2011 12:31:20 +0100 Subject: [PATCH] fix color calculation off by one --- pandora/archive/extract.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandora/archive/extract.py b/pandora/archive/extract.py index 8fa9360c..fc841b72 100644 --- a/pandora/archive/extract.py +++ b/pandora/archive/extract.py @@ -294,7 +294,7 @@ def average_color(prefix, start=0, end=0): timelines = sorted(filter(lambda t: t!= '%s%sp.png'%(prefix,height), glob("%s%sp*.png"%(prefix, height)))) for image in timelines: start_offset = 0 - if start and frames + 1500 < start: + if start and frames + 1500 <= start: frames += 1500 continue timeline = Image.open(image) @@ -311,7 +311,6 @@ def average_color(prefix, start=0, end=0): p = np.asarray(timeline.convert('RGB'), dtype=np.float32) p = np.sum(p, axis=0) / height #average color per frame pixels.append(p) - if end and frames >= end: break