resize frame only once

This commit is contained in:
j 2010-08-25 14:21:44 +02:00
parent 76021b1b78
commit 9d7e6ecdac

View file

@ -72,10 +72,10 @@ class Timeline(Video):
self._ready = True
else:
_framePos = int(math.ceil((float(timestamp) / (gst.SECOND) * float(self.framerate))))
frame = frame.resize((1, self.tile_height), Image.ANTIALIAS)
for framePos in range(self.lastPos, _framePos):
tile = int(math.floor(float(framePos) / self.input_tile_width))
tilePos = framePos - (tile * self.input_tile_width)
frame = frame.resize((1, self.tile_height), Image.ANTIALIAS)
for i in range(self.tile_height):
self.tiles[tile].putpixel((tilePos, i), frame.getpixel((0, i)))