Update artresizer's ImageMagick commands to use the magick binary

Updated artresizer's ImageMagick commands to use the magick binary
added in ImageMagick 7.x, rather than the legacy utilities ('convert',
'identify', etc.) This resolves an issue where beets is failing to
detect or use ImageMagick on Windows even when it is set correctly
on the PATH, which in turn restores functionality to the fetchart and
embedart plugins on Windows.

Closes #2093
This commit is contained in:
ababyduck 2019-04-22 23:12:51 -07:00
parent 4d55e6dfbb
commit ad9f256058

View file

@ -93,7 +93,7 @@ def im_resize(maxwidth, path_in, path_out=None):
# with regards to the height.
try:
util.command_output([
'convert', util.syspath(path_in, prefix=False),
'magick', util.syspath(path_in, prefix=False),
'-resize', '{0}x>'.format(maxwidth),
util.syspath(path_out, prefix=False),
])
@ -121,7 +121,7 @@ def pil_getsize(path_in):
def im_getsize(path_in):
cmd = ['identify', '-format', '%w %h',
cmd = ['magick', 'identify', '-format', '%w %h',
util.syspath(path_in, prefix=False)]
try:
out = util.command_output(cmd)
@ -235,7 +235,7 @@ def get_im_version():
Try invoking ImageMagick's "convert".
"""
try:
out = util.command_output(['convert', '--version'])
out = util.command_output(['magick', '-version'])
if b'imagemagick' in out.lower():
pattern = br".+ (\d+)\.(\d+)\.(\d+).*"