dont fail for clips without color

This commit is contained in:
j 2014-09-16 08:52:46 +00:00
parent 09f30b3c5a
commit f244476138

View file

@ -1279,7 +1279,7 @@ class Item(models.Model):
n = streams.count() n = streams.count()
for s in streams: for s in streams:
self.data['volume'] += s.volume * s.duration self.data['volume'] += s.volume * s.duration
color = map(lambda a,b: (a+b)/n, color,ox.image.getRGB(s.color)) color = map(lambda a,b: (a+b)/n, color, ox.image.getRGB(s.color or [0.0] * 3))
offset += s.duration offset += s.duration
self.data['hue'], self.data['saturation'], self.data['lightness'] = ox.image.getHSL(color) self.data['hue'], self.data['saturation'], self.data['lightness'] = ox.image.getHSL(color)
if offset: if offset: