Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imgconverter fails to find ImageMagick on Windows #7477

Closed
Daltz333 opened this issue Apr 13, 2020 · 6 comments
Closed

Imgconverter fails to find ImageMagick on Windows #7477

Daltz333 opened this issue Apr 13, 2020 · 6 comments

Comments

@Daltz333
Copy link

Daltz333 commented Apr 13, 2020

ImageMagick fails on Windows due to backslash acting as a Python delimiter.

Issue

ImageMagick is installed on my Windows 10 (Build 2004) machine, but it fails with Invalid Drive Specification. Opening a powershell and running convert mysvg.svg mysvg.png works as intended, so this is a Sphinx specific issue.

Workaround

Specify ImageMagick path using
image_converter = "D:\\System Programs\\ImageMagick-7.0.10-Q16\\convert.exe"

@Daltz333
Copy link
Author

I've moved ImageMagick to a non-spaced path on my internal drive and the same issue arises.

@Daltz333
Copy link
Author

Daltz333 commented Apr 13, 2020

The actual issue was that a program with the name convert already exists in Windows path. Our solution was to do

# SVG support
image_converter = "magick"
image_converter_args = "convert"

@tk0miya tk0miya added this to the 3.1.0 milestone Apr 14, 2020
@tk0miya
Copy link
Member

tk0miya commented Apr 14, 2020

Thank you for reporting. Good idea to use magick command instead.

Note: It seems Debian/Ubuntu does not provide the command...

@Daltz333
Copy link
Author

That is correct. Debian/Ubuntu default release is still on ImageMagick6, this is introduced in ImageMagick7.

@Daltz333
Copy link
Author

We've worked around this by using

if os.name == 'nt':

@tk0miya
Copy link
Member

tk0miya commented Apr 14, 2020

Thank you for comment. I just posted a PR #7483 that switches command by platform. Could you check this please? It is very helpful to me because I don't have windows PC.

tk0miya added a commit that referenced this issue Apr 15, 2020
Fix #7477: imgconverter: Invoke "magick convert" command on Windows
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants