check if its first position

This commit is contained in:
j 2012-06-15 23:57:03 +02:00
parent cde92a1624
commit 1e88e6697f
1 changed files with 3 additions and 2 deletions

View File

@ -55,6 +55,7 @@ def get_sequences(path, position=0):
sequences = {}
for mode in modes:
sequences[mode] = []
position_start = position
fps = 25
file_names = filter(lambda x: 'timelinedata8p' in x, os.listdir(path))
file_names = sorted(file_names, key=lambda x: int(x[14:-4]))
@ -66,8 +67,8 @@ def get_sequences(path, position=0):
frame_image = timeline_image.crop((x, 0, x + 8, 8))
for mode in modes:
frame_hash = get_hash(frame_image, mode)
if position == 0 or frame_hash != sequences[mode][-1]['hash']:
if position > 0:
if position == position_start or frame_hash != sequences[mode][-1]['hash']:
if position > position_start:
sequences[mode][-1]['out'] = position
sequences[mode].append({'in': position, 'hash': frame_hash})
position += 1 / fps