summaryrefslogtreecommitdiff
path: root/pywal
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-07-08 11:58:43 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-07-08 11:58:43 +1000
commite839fab860a6ce415754af626c4afe00d8e9741a (patch)
tree68e2e5ef0cebc6d0b6b9958b1bbe919d4a6b591e /pywal
parentbf88cd7881fce77298ec6df526a1784827acfbe4 (diff)
magic: Fixed infinite loop when wal is given a really simple image.
Diffstat (limited to 'pywal')
-rw-r--r--pywal/magic.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pywal/magic.py b/pywal/magic.py
index 406a513..d4dd213 100644
--- a/pywal/magic.py
+++ b/pywal/magic.py
@@ -41,6 +41,11 @@ def gen_colors(img):
"color palette, trying a larger palette size",
COLOR_COUNT + index)
+ if index > 20:
+ print("colors: Imagemagick couldn't generate a suitable scheme",
+ "for the image. Exiting...")
+ quit(1)
+
# Remove the first element, which isn't a color.
del raw_colors[0]