From 4bdce553647a73259f761c9dd51153a4f18d352c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 2 Nov 2015 09:34:41 +0100 Subject: [PATCH] fix joining audio only timelines --- pandora/item/timelines.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pandora/item/timelines.py b/pandora/item/timelines.py index b2334855..167895f5 100644 --- a/pandora/item/timelines.py +++ b/pandora/item/timelines.py @@ -116,10 +116,11 @@ def join_tiles(source_paths, target_path): for info in sorted(file_info, key=lambda x: x['index']): mode = info['mode'] source_files[mode].append(path + info['file']) - if mode == modes[0]: - width = Image.open(source_files[mode][-1]).size[0] - durations[i] += width / fps - frame_n += width + modes = [m for m in modes if source_files[m]] + for f in source_files[modes[0]]: + width = Image.open(f).size[0] + durations[i] += width / fps + frame_n += width large_tile_n = int(math.ceil(frame_n / large_tile_w)) large_tile_last_w = frame_n % large_tile_w or 60 small_tile_n = int(math.ceil(frame_n / fps / small_tile_w))