Skip to content

Commit

Permalink
remove possible garbage data
Browse files Browse the repository at this point in the history
it is possible we can pick part of the Imagemagick "banner" from STDOUT as garbage data
in specific the "# Image" sequence, so if it exists on the colors list, remove it.
  • Loading branch information
eylles committed May 7, 2024
1 parent 1ebea0b commit e00ed40
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pywal/backends/wal.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,8 @@ def adjust(cols, light, cols16):
def get(img, light=False, cols16=False):
"""Get colorscheme."""
colors = gen_colors(img)
# it is possible we could have picked garbage data
garbage = "# Image"
if garbage in colors:
colors.remove(garbage)
return adjust(colors, light, cols16)

0 comments on commit e00ed40

Please sign in to comment.