forked from 0x2620/pandora
avoid division by 0
This commit is contained in:
parent
3bed914023
commit
ba186ffd10
2 changed files with 7 additions and 3 deletions
|
@ -317,9 +317,10 @@ def average_color(prefix, start=0, end=0):
|
||||||
|
|
||||||
if end:
|
if end:
|
||||||
frames = end - start
|
frames = end - start
|
||||||
for i in range(0, len(pixels)):
|
if frames:
|
||||||
p = np.sum(pixels[i], axis=0) / frames
|
for i in range(0, len(pixels)):
|
||||||
color += p
|
p = np.sum(pixels[i], axis=0) / frames
|
||||||
|
color += p
|
||||||
color = list(map(float, color))
|
color = list(map(float, color))
|
||||||
return ox.image.getHSL(color)
|
return ox.image.getHSL(color)
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,9 @@ def parseCondition(condition, user):
|
||||||
return ~q
|
return ~q
|
||||||
else:
|
else:
|
||||||
return q
|
return q
|
||||||
|
if (not exclude and op == '=' or op in ('$', '^', '>=', '<')) and v == '':
|
||||||
|
return Q(True)
|
||||||
|
|
||||||
if k.endswith('__id'):
|
if k.endswith('__id'):
|
||||||
v = decode_id(v)
|
v = decode_id(v)
|
||||||
if isinstance(v, bool): #featured and public flag
|
if isinstance(v, bool): #featured and public flag
|
||||||
|
|
Loading…
Reference in a new issue