mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Handling mis-shapen icons.
This commit is contained in:
parent
61fb9f1719
commit
e1cf12888a
1 changed files with 1 additions and 1 deletions
|
@ -326,9 +326,9 @@ class IconImporter(object):
|
|||
# Reshape array of values to merge color bands. [[R], [G], [B], [A]] => [R, G, B, A]
|
||||
if len(shape) > 2:
|
||||
ar = ar.reshape(scipy.product(shape[:2]), shape[2])
|
||||
ar = ar.astype(numpy.float)
|
||||
|
||||
# Get NUM_CLUSTERS worth of centroids.
|
||||
ar = ar.astype(numpy.float)
|
||||
codes, _ = scipy.cluster.vq.kmeans(ar, NUM_CLUSTERS)
|
||||
|
||||
# Pare centroids, removing blacks and whites and shades of really dark and really light.
|
||||
|
|
Loading…
Add table
Reference in a new issue