From f47febb09cbc0133b94ddf450e229cb623550390 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 9 Dec 2015 18:29:18 +0000 Subject: [PATCH] joined audio timelines --- pandora/item/models.py | 3 +++ pandora/item/timelines.py | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index b4574d2a..4839fb70 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1401,6 +1401,9 @@ class Item(models.Model): frame = self.get_poster_frame_path() timeline = '%stimelineantialias64p.jpg' % self.timeline_prefix + audio_timeline = '%stimelineaudio64p.jpg' % self.timeline_prefix + if not os.path.exists(timeline) and os.path.exists(audio_timeline): + timeline = audio_timeline cmd = [settings.ITEM_POSTER, '-d', '-', diff --git a/pandora/item/timelines.py b/pandora/item/timelines.py index cbc44b82..7492f7b6 100644 --- a/pandora/item/timelines.py +++ b/pandora/item/timelines.py @@ -83,7 +83,7 @@ def join_tiles(source_paths, target_path): ) data['target_images']['small'].save(image_file) #print image_file - if mode == 'antialias': + if mode == full_tile_mode: # render full tile resized = data['target_images']['large'].resize(( data['full_tile_widths'][0], large_tile_h @@ -127,6 +127,7 @@ def join_tiles(source_paths, target_path): large_tile_last_w = frame_n % large_tile_w or 60 small_tile_n = int(math.ceil(frame_n / fps / small_tile_w)) small_tile_last_w = int(math.ceil(frame_n / fps)) % small_tile_w or small_tile_w + full_tile_mode = modes[0] # open full timeline if large_tile_n == 1: @@ -168,10 +169,10 @@ def join_tiles(source_paths, target_path): save_and_open(data) # save full timelines - image_file = '%stimelineantialias%dp.jpg' % (target_path, large_tile_h) + image_file = '%stimeline%s%dp.jpg' % (target_path, full_tile_mode, large_tile_h) data['target_images']['full'].save(image_file) #print image_file - image_file = '%stimelineantialias%dp.jpg' % (target_path, small_tile_h) + image_file = '%stimeline%s%dp.jpg' % (target_path, full_tile_mode, small_tile_h) data['target_images']['full'].resize( (full_tile_w, small_tile_h), Image.ANTIALIAS ).save(image_file)