0xdb poster script: only add frames if duration exists

This commit is contained in:
rolux 2013-06-06 19:36:49 +02:00
parent a53d41d1af
commit 882de2a13a
1 changed files with 15 additions and 14 deletions

View File

@ -84,6 +84,7 @@ def render_poster(data, poster):
poster_image.putpixel((margin + x, margin + y), color)
# small frames
if duration:
for i in range(small_frames):
position = duration * (i + 1) / (small_frames + 1)
small_frame_url = 'https://0xdb.org/%s/96p%f.jpg' % (id, round(position * 25) / 25)