From cdae6c0fe8134731139083270e8cd7f234a63bd7 Mon Sep 17 00:00:00 2001 From: cgohlke Date: Sun, 12 Aug 2018 22:40:58 -0700 Subject: [PATCH] Use ImageMagick's magick.exe if convert.exe is not installed On Windows, ImageMagick >= 7 does not include convert.exe by default. Instead the converter is built into magick.exe. --- lib/matplotlib/animation.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index 9dd3f68f0a8c..afe466e0af06 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -735,10 +735,17 @@ def _init_from_registry(cls): 0, winreg.KEY_QUERY_VALUE | flag) binpath = winreg.QueryValueEx(hkey, 'BinPath')[0] winreg.CloseKey(hkey) - binpath += r'\convert.exe' break except Exception: binpath = '' + if binpath: + for exe in ('convert.exe', 'magick.exe'): + path = os.path.join(binpath, exe) + if os.path.exists(path): + binpath = path + break + else: + binpath = '' rcParams[cls.exec_key] = rcParamsDefault[cls.exec_key] = binpath @classmethod