From 73f897aa58e377d9afef622d2a8a7379a43d6af9 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 8 Sep 2010 13:23:07 +0200 Subject: [PATCH] 16x timelines are one hour each --- bin/oxtimeline | 2 +- oxgst/timeline.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/oxtimeline b/bin/oxtimeline index 81e4113..6f0f319 100755 --- a/bin/oxtimeline +++ b/bin/oxtimeline @@ -32,7 +32,7 @@ if __name__ == '__main__': timeline = oxgst.Timeline(opts.input) timeline.extract(opts.prefix, opts.width, opts.height) oxgst.timeline.createTimelineMultiline(opts.prefix) - oxgst.timeline.makeTiles(opts.prefix, 16) + oxgst.timeline.makeTiles(opts.prefix, 16, 3600) oxgst.timeline.makeTimelineOverview(opts.prefix, 1920) diff --git a/oxgst/timeline.py b/oxgst/timeline.py index 0c15891..39b5896 100644 --- a/oxgst/timeline.py +++ b/oxgst/timeline.py @@ -195,17 +195,18 @@ def makeTimelineOverview(timeline_prefix, width, inpoint=0, outpoint=0, duration timeline = timeline.crop((inpoint, 0, outpoint, timeline.size[1])).resize((width, height), Image.ANTIALIAS) timeline.save(timeline_file) -def makeTiles(timeline_prefix, height=16): +def makeTiles(timeline_prefix, height=16, width=3600): files = glob('%s.64.*.png' % timeline_prefix) + fps = 25 part_step = 60 - output_width = 300 + output_width = width width = len(files) * part_step timeline = Image.new("RGB", (width, height)) pos = 0 for f in sorted(files): part = Image.open(f) - part_width = int(part.size[0] / 25) + part_width = int(part.size[0] / fps) part = part.resize((part_width, height), Image.ANTIALIAS) timeline.paste(part, (pos, 0, pos+part_width, height)) pos += part_width @@ -218,5 +219,5 @@ def makeTiles(timeline_prefix, height=16): end = min(pos+output_width, timeline.size[0]) timeline.crop((pos, 0, end, timeline.size[1])).save('%s.%s.%04d.png' % (timeline_prefix, timeline.size[1], i)) pos += output_width - i += 5 + i += 1