Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 53a070e

Browse files
tacaswellMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR #11847: Use ImageMagick's magick.exe if convert.exe is not installed
1 parent a7d9384 commit 53a070e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/matplotlib/animation.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,10 +735,17 @@ def _init_from_registry(cls):
735735
0, winreg.KEY_QUERY_VALUE | flag)
736736
binpath = winreg.QueryValueEx(hkey, 'BinPath')[0]
737737
winreg.CloseKey(hkey)
738-
binpath += r'\convert.exe'
739738
break
740739
except Exception:
741740
binpath = ''
741+
if binpath:
742+
for exe in ('convert.exe', 'magick.exe'):
743+
path = os.path.join(binpath, exe)
744+
if os.path.exists(path):
745+
binpath = path
746+
break
747+
else:
748+
binpath = ''
742749
rcParams[cls.exec_key] = rcParamsDefault[cls.exec_key] = binpath
743750

744751
@classmethod

0 commit comments

Comments
 (0)