diff --git a/pandora/archive/extract.py b/pandora/archive/extract.py index 1c952ffe..8fa9360c 100644 --- a/pandora/archive/extract.py +++ b/pandora/archive/extract.py @@ -317,9 +317,10 @@ def average_color(prefix, start=0, end=0): if end: frames = end - start - for i in range(0, len(pixels)): - p = np.sum(pixels[i], axis=0) / frames - color += p + if frames: + for i in range(0, len(pixels)): + p = np.sum(pixels[i], axis=0) / frames + color += p color = list(map(float, color)) return ox.image.getHSL(color) diff --git a/pandora/clip/managers.py b/pandora/clip/managers.py index eae7e1f2..82b02dec 100644 --- a/pandora/clip/managers.py +++ b/pandora/clip/managers.py @@ -59,6 +59,9 @@ def parseCondition(condition, user): return ~q else: return q + if (not exclude and op == '=' or op in ('$', '^', '>=', '<')) and v == '': + return Q(True) + if k.endswith('__id'): v = decode_id(v) if isinstance(v, bool): #featured and public flag