From cf0fcdbc5f288d1562227fbb9c8694d41e5ad4b8 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 15 Sep 2016 15:13:16 +0000 Subject: [PATCH] only paste into small timeline if it exists --- pandora/item/timelines.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pandora/item/timelines.py b/pandora/item/timelines.py index d1fa54209..c7e587fcc 100644 --- a/pandora/item/timelines.py +++ b/pandora/item/timelines.py @@ -75,16 +75,17 @@ def join_tiles(source_paths, durations, target_path): data['target_images']['large'] = data['target_images']['large'].resize( (w, small_tile_h), Image.ANTIALIAS ) - data['target_images']['small'].paste( - data['target_images']['large'], (small_tile_x, 0) - ) - # save small tile - if small_tile_x == small_tile_w - 60 or large_tile_i == large_tile_n - 1: - image_file = '%stimeline%s%dp%d.jpg' % ( - target_path, small_mode, small_tile_h, small_tile_i + if data['target_images']['small']: + data['target_images']['small'].paste( + data['target_images']['large'], (small_tile_x, 0) ) - data['target_images']['small'].save(image_file) - #print(image_file) + # save small tile + if small_tile_x == small_tile_w - 60 or large_tile_i == large_tile_n - 1: + image_file = '%stimeline%s%dp%d.jpg' % ( + target_path, small_mode, small_tile_h, small_tile_i + ) + data['target_images']['small'].save(image_file) + #print(image_file) if mode == full_tile_mode: # render full tile if data['full_tile_widths'][0]: