From 54fdbe7f2cbf3fe2c19ceef6d1be0da300ba0c0e Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 13 Aug 2011 12:03:30 +0200 Subject: [PATCH] padma poster should not fail without timeline --- pandora/scripts/padma_poster | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pandora/scripts/padma_poster b/pandora/scripts/padma_poster index e4c2af07..b5226654 100755 --- a/pandora/scripts/padma_poster +++ b/pandora/scripts/padma_poster @@ -30,11 +30,12 @@ def render_poster(id, title, frame, timeline, poster): # timeline timeline_height = 64 timeline_lines = 16 - timeline_image = Image.open(timeline) - timeline_image = timeline_image.resize((10240, timeline_height), Image.ANTIALIAS) - for i in range(timeline_lines): - line_image = timeline_image.crop((i * poster_width, 0, (i + 1) * poster_width, 64)) - poster_image.paste(line_image, (0, i * timeline_height)) + if timeline: + timeline_image = Image.open(timeline) + timeline_image = timeline_image.resize((10240, timeline_height), Image.ANTIALIAS) + for i in range(timeline_lines): + line_image = timeline_image.crop((i * poster_width, 0, (i + 1) * poster_width, 64)) + poster_image.paste(line_image, (0, i * timeline_height)) # id text = 'Pad.ma/' + id