mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-03-14 23:28:30 +01:00
colors: Use separate command on Windows
This commit is contained in:
parent
2c4e17a197
commit
3c7b0fd840
@ -7,13 +7,18 @@ import shutil
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from .settings import CACHE_DIR, COLOR_COUNT
|
from .settings import CACHE_DIR, COLOR_COUNT, OS
|
||||||
from . import util
|
from . import util
|
||||||
|
|
||||||
|
|
||||||
def imagemagick(color_count, img):
|
def imagemagick(color_count, img):
|
||||||
"""Call Imagemagick to generate a scheme."""
|
"""Call Imagemagick to generate a scheme."""
|
||||||
colors = subprocess.Popen(["magick", "convert", img, "-resize", "25%",
|
if OS == "Windows":
|
||||||
|
magick_command = ["magick", "convert"]
|
||||||
|
else:
|
||||||
|
magick_command = ["convert"]
|
||||||
|
|
||||||
|
colors = subprocess.Popen([*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)
|
||||||
|
Loading…
Reference in New Issue
Block a user