padma poster should not fail without timeline
This commit is contained in:
parent
799930c395
commit
63a4aac9fd
1 changed files with 6 additions and 5 deletions
|
@ -30,11 +30,12 @@ def render_poster(id, title, frame, timeline, poster):
|
||||||
# timeline
|
# timeline
|
||||||
timeline_height = 64
|
timeline_height = 64
|
||||||
timeline_lines = 16
|
timeline_lines = 16
|
||||||
timeline_image = Image.open(timeline)
|
if timeline:
|
||||||
timeline_image = timeline_image.resize((10240, timeline_height), Image.ANTIALIAS)
|
timeline_image = Image.open(timeline)
|
||||||
for i in range(timeline_lines):
|
timeline_image = timeline_image.resize((10240, timeline_height), Image.ANTIALIAS)
|
||||||
line_image = timeline_image.crop((i * poster_width, 0, (i + 1) * poster_width, 64))
|
for i in range(timeline_lines):
|
||||||
poster_image.paste(line_image, (0, i * timeline_height))
|
line_image = timeline_image.crop((i * poster_width, 0, (i + 1) * poster_width, 64))
|
||||||
|
poster_image.paste(line_image, (0, i * timeline_height))
|
||||||
|
|
||||||
# id
|
# id
|
||||||
text = 'Pad.ma/' + id
|
text = 'Pad.ma/' + id
|
||||||
|
|
Loading…
Reference in a new issue