You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If kmeans is installed from pypi, it's broken because themer passes (r, g, b, a) to it where it only expects (r, g, b). See the below exception
$ themer generate color-squares downloads/JmTbnY8.png
# example value ((31, 124, 141, 255), 1)
Traceback (most recent call last):
File "/home/coxley/.local/bin/themer", line 323, in <module>
generate(color_file, config, template_dir, theme_name, options.bright)
File "/home/coxley/.local/bin/themer", line 170, in generate
colors = parse.read()
File "/home/coxley/.local/lib/python3.6/site-packages/themer/parsers/__init__.py", line 159, in read
colors = self.get_dominant_colors()
File "/home/coxley/.local/lib/python3.6/site-packages/themer/parsers/__init__.py", line 142, in get_dominant_colors
rgbs = kmeans.kmeans(points, self.k)
File "/home/coxley/.local/lib/python3.6/site-packages/kmeans/__init__.py", line 104, in kmeans
tolerance=tolerance, max_iterations=max_iterations)
File "/home/coxley/.local/lib/python3.6/site-packages/kmeans/__init__.py", line 61, in _kmeans
(r, g, b), count = center
ValueError: too many values to unpack (expected 3)
Removing kmeans/manually patching fixes this however then it gets stopped writing
Falling back to python kmeans implementation.
Consider installing 'kmeans' from PyPI for much faster image sampling
Activate now? yN y
Traceback (most recent call last):
File "/home/coxley/.local/lib/python3.6/site-packages/PIL/JpegImagePlugin.py", line 602, in _save
rawmode = RAWMODE[im.mode]
KeyError: 'RGBA'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/coxley/.local/bin/themer", line 336, in <module>
activate(theme_name)
File "/home/coxley/.local/bin/themer", line 157, in activate
act.activate()
File "/home/coxley/.local/lib/python3.6/site-packages/themer/activators/wallfix.py", line 90, in activate
self.crop_wallpaper(wallpaper)
File "/home/coxley/.local/lib/python3.6/site-packages/themer/activators/wallfix.py", line 76, in crop_wallpaper
cropped.save(dest_jpg, 'JPEG', quality=100)
File "/home/coxley/.local/lib/python3.6/site-packages/PIL/Image.py", line 1893, in save
save_handler(self, fp, filename)
File "/home/coxley/.local/lib/python3.6/site-packages/PIL/JpegImagePlugin.py", line 604, in _save
raise IOError("cannot write mode %s as JPEG" % im.mode)
OSError: cannot write mode RGBA as JPEG
The text was updated successfully, but these errors were encountered:
s-ol
changed the title
Both kmeans and writing image broken
Images with alpha channel break kmeans and wallfix
Aug 1, 2017
If
kmeans
is installed from pypi, it's broken becausethemer
passes(r, g, b, a)
to it where it only expects(r, g, b)
. See the below exceptionRemoving kmeans/manually patching fixes this however then it gets stopped writing
The text was updated successfully, but these errors were encountered: