merge
This commit is contained in:
commit
e669790e0f
3 changed files with 10 additions and 7 deletions
|
@ -294,7 +294,7 @@ def average_color(prefix, start=0, end=0):
|
||||||
timelines = sorted(filter(lambda t: t!= '%s%sp.png'%(prefix,height), glob("%s%sp*.png"%(prefix, height))))
|
timelines = sorted(filter(lambda t: t!= '%s%sp.png'%(prefix,height), glob("%s%sp*.png"%(prefix, height))))
|
||||||
for image in timelines:
|
for image in timelines:
|
||||||
start_offset = 0
|
start_offset = 0
|
||||||
if start and frames + 1500 < start:
|
if start and frames + 1500 <= start:
|
||||||
frames += 1500
|
frames += 1500
|
||||||
continue
|
continue
|
||||||
timeline = Image.open(image)
|
timeline = Image.open(image)
|
||||||
|
@ -311,15 +311,15 @@ def average_color(prefix, start=0, end=0):
|
||||||
p = np.asarray(timeline.convert('RGB'), dtype=np.float32)
|
p = np.asarray(timeline.convert('RGB'), dtype=np.float32)
|
||||||
p = np.sum(p, axis=0) / height #average color per frame
|
p = np.sum(p, axis=0) / height #average color per frame
|
||||||
pixels.append(p)
|
pixels.append(p)
|
||||||
|
|
||||||
if end and frames >= end:
|
if end and frames >= end:
|
||||||
break
|
break
|
||||||
|
|
||||||
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
|
||||||
|
|
|
@ -34,8 +34,8 @@ class List(models.Model):
|
||||||
icon = models.ImageField(default=None, blank=True,
|
icon = models.ImageField(default=None, blank=True,
|
||||||
upload_to=lambda i, x: i.path("icon.jpg"))
|
upload_to=lambda i, x: i.path("icon.jpg"))
|
||||||
|
|
||||||
view = models.TextField(default=lambda: settings.CONFIG['user']['ui']['listView'])
|
view = models.TextField(default=lambda: tuple(settings.CONFIG['user']['ui']['listView']))
|
||||||
sort = TupleField(default=lambda: settings.CONFIG['user']['ui']['listSort'], editable=False)
|
sort = TupleField(default=lambda: tuple(settings.CONFIG['user']['ui']['listSort']), editable=False)
|
||||||
|
|
||||||
poster_frames = TupleField(default=[], editable=False)
|
poster_frames = TupleField(default=[], editable=False)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue