mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-06-12 04:37:08 +02:00
Merge pull request #111 from linuxunil/master
Use run instead of popen so that things are closed correctly
This commit is contained in:
commit
637e31e9a8
@ -18,12 +18,12 @@ def imagemagick(color_count, img):
|
|||||||
else:
|
else:
|
||||||
magick_command = ["convert"]
|
magick_command = ["convert"]
|
||||||
|
|
||||||
colors = subprocess.Popen([*magick_command, img, "-resize", "25%",
|
colors = subprocess.run([*magick_command, img, "-resize", "25%",
|
||||||
"+dither", "-colors", str(color_count),
|
"+dither", "-colors", str(color_count),
|
||||||
"-unique-colors", "txt:-"],
|
"-unique-colors", "txt:-"],
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
|
|
||||||
return colors.stdout.readlines()
|
return colors.stdout.splitlines()
|
||||||
|
|
||||||
|
|
||||||
def gen_colors(img, color_count):
|
def gen_colors(img, color_count):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user