-
Notifications
You must be signed in to change notification settings - Fork 70
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
Compile ImageMagick with the RSVG delegate enabled #131
Comments
I created the following script to configure and install everything for me. https://gist.github.com/Daltz333/3d0d4d04f45fd47604a98b60c2bf15b9 |
Okay, an easier solution is to install Inkscape as ImageMagick will use that if installed. |
I'm not too familiarized with this problem.
Do you have any resource that I can read about this? I'm not opposite to add this package, but "being used automatically" means that it will affect all the users, and I'm not sure that won't produce unexpected output for them. |
Would it be possible for this package to exist on a per build/project basis? |
Hi there, we are also observing similar things with ImageMagick (6.9.7-4 croaks while 7.0.10-29 apparently works), so I believe it would be a good idea to share our findings at earthobservations/wetterdienst#155 (comment) with you. While we will move on with Most probably, some things will resolve after merging #137. With kind regards, Edit: We had no luck even after moving on to |
Apparently, [the Debian/Ubuntu build of ImageMagick doesn't enable RSVG](readthedocs/readthedocs-docker-images#131 (comment)) so we have to use the much larger inkscape dependency: :1+./.tox/py311/bin/sphinx-build -b latex -Wn -j auto -D autosummary_generate=0 -D autoapi_generate_api_docs=0 ./docs/ ./build/docs/latex/ Extension error: convert exited with error: [stderr] b"convert-im6.q16: unrecognized color `d5d5d5' @ warning/color.c/GetColorCompliance/1057.\nconvert-im6.q16: non-conforming drawing primitive definition `stroke' @ error/draw.c/RenderMVGContent/4404.\n" [stdout] b'' make: *** [Makefile:376: build-docs-latex] Error 2
Per readthedocs/readthedocs-docker-images#131 (comment), the solution is to install inkscape in the RTD environment.
It seems that this issue still exists in 2024. To install Inkscape, one can add build:
apt_packages:
- inkscape |
Per readthedocs/readthedocs-docker-images#131 (comment), the solution is to install inkscape in the RTD environment. See error in the log: https://readthedocs.org/projects/deepmd/builds/24116201/ ``` Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/ext/imgconverter.py", line 59, in convert subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True) File "/home/docs/.asdf/installs/python/3.11.6/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['convert', '/home/docs/checkouts/readthedocs.org/user_builds/deepmd/checkouts/latest/doc/_static/pytorch.svg[0]', '/home/docs/checkouts/readthedocs.org/user_builds/deepmd/checkouts/latest/doc/_build/doctrees/images/pytorch.png']' returned non-zero exit status 1. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/cmd/build.py", line 281, in build_main app.build(args.force_all, args.filenames) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/application.py", line 347, in build self.builder.build_update() File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 307, in build_update self.build(['__all__'], to_build) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 376, in build self.write(docnames, list(updated_docnames), method) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/builders/latex/__init__.py", line 285, in write doctree = self.assemble_doctree( ^^^^^^^^^^^^^^^^^^^^^^ File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/builders/latex/__init__.py", line 349, in assemble_doctree self.env.resolve_references(largetree, indexfile, self) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/environment/__init__.py", line 625, in resolve_references self.apply_post_transforms(doctree, fromdocname) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/environment/__init__.py", line 637, in apply_post_transforms transformer.apply_transforms() File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/transforms/__init__.py", line 80, in apply_transforms super().apply_transforms() File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/docutils/transforms/__init__.py", line 171, in apply_transforms transform.apply(**kwargs) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/transforms/post_transforms/images.py", line 27, in apply self.handle(node) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/transforms/post_transforms/images.py", line 244, in handle if self.convert(abs_srcpath, destpath): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/ext/imgconverter.py", line 67, in convert raise ExtensionError(__('convert exited with error:\n' sphinx.errors.ExtensionError: convert exited with error: [stderr] b"convert-im6.q16: non-conforming drawing primitive definition `l-1.744' @ error/draw.c/TracePath/6288.\nconvert-im6.q16: non-conforming drawing primitive definition `path' @ error/draw.c/RenderMVGContent/4301.\n" [stdout] b'' Extension error: convert exited with error: [stderr] b"convert-im6.q16: non-conforming drawing primitive definition `l-1.744' @ error/draw.c/TracePath/6288.\nconvert-im6.q16: non-conforming drawing primitive definition `path' @ error/draw.c/RenderMVGContent/4301.\n" [stdout] b'' ```
Per readthedocs/readthedocs-docker-images#131 (comment), the solution is to install inkscape in the RTD environment. See error in the log: https://readthedocs.org/projects/deepmd/builds/24116201/ ``` Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/ext/imgconverter.py", line 59, in convert subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True) File "/home/docs/.asdf/installs/python/3.11.6/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['convert', '/home/docs/checkouts/readthedocs.org/user_builds/deepmd/checkouts/latest/doc/_static/pytorch.svg[0]', '/home/docs/checkouts/readthedocs.org/user_builds/deepmd/checkouts/latest/doc/_build/doctrees/images/pytorch.png']' returned non-zero exit status 1. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/cmd/build.py", line 281, in build_main app.build(args.force_all, args.filenames) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/application.py", line 347, in build self.builder.build_update() File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 307, in build_update self.build(['__all__'], to_build) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 376, in build self.write(docnames, list(updated_docnames), method) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/builders/latex/__init__.py", line 285, in write doctree = self.assemble_doctree( ^^^^^^^^^^^^^^^^^^^^^^ File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/builders/latex/__init__.py", line 349, in assemble_doctree self.env.resolve_references(largetree, indexfile, self) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/environment/__init__.py", line 625, in resolve_references self.apply_post_transforms(doctree, fromdocname) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/environment/__init__.py", line 637, in apply_post_transforms transformer.apply_transforms() File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/transforms/__init__.py", line 80, in apply_transforms super().apply_transforms() File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/docutils/transforms/__init__.py", line 171, in apply_transforms transform.apply(**kwargs) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/transforms/post_transforms/images.py", line 27, in apply self.handle(node) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/transforms/post_transforms/images.py", line 244, in handle if self.convert(abs_srcpath, destpath): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/ext/imgconverter.py", line 67, in convert raise ExtensionError(__('convert exited with error:\n' sphinx.errors.ExtensionError: convert exited with error: [stderr] b"convert-im6.q16: non-conforming drawing primitive definition `l-1.744' @ error/draw.c/TracePath/6288.\nconvert-im6.q16: non-conforming drawing primitive definition `path' @ error/draw.c/RenderMVGContent/4301.\n" [stdout] b'' Extension error: convert exited with error: [stderr] b"convert-im6.q16: non-conforming drawing primitive definition `l-1.744' @ error/draw.c/TracePath/6288.\nconvert-im6.q16: non-conforming drawing primitive definition `path' @ error/draw.c/RenderMVGContent/4301.\n" [stdout] b'' ```
We don't plan to modify the Docker images we use to build the documentation. Since there is a solution already proposed here by installing Inkscape at build time, I'll proceed to close this issue as not planned. |
Per readthedocs/readthedocs-docker-images#131 (comment), the solution is to install inkscape in the RTD environment. See error in the log: https://readthedocs.org/projects/deepmd/builds/24116201/ ``` Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/ext/imgconverter.py", line 59, in convert subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True) File "/home/docs/.asdf/installs/python/3.11.6/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['convert', '/home/docs/checkouts/readthedocs.org/user_builds/deepmd/checkouts/latest/doc/_static/pytorch.svg[0]', '/home/docs/checkouts/readthedocs.org/user_builds/deepmd/checkouts/latest/doc/_build/doctrees/images/pytorch.png']' returned non-zero exit status 1. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/cmd/build.py", line 281, in build_main app.build(args.force_all, args.filenames) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/application.py", line 347, in build self.builder.build_update() File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 307, in build_update self.build(['__all__'], to_build) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 376, in build self.write(docnames, list(updated_docnames), method) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/builders/latex/__init__.py", line 285, in write doctree = self.assemble_doctree( ^^^^^^^^^^^^^^^^^^^^^^ File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/builders/latex/__init__.py", line 349, in assemble_doctree self.env.resolve_references(largetree, indexfile, self) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/environment/__init__.py", line 625, in resolve_references self.apply_post_transforms(doctree, fromdocname) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/environment/__init__.py", line 637, in apply_post_transforms transformer.apply_transforms() File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/transforms/__init__.py", line 80, in apply_transforms super().apply_transforms() File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/docutils/transforms/__init__.py", line 171, in apply_transforms transform.apply(**kwargs) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/transforms/post_transforms/images.py", line 27, in apply self.handle(node) File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/transforms/post_transforms/images.py", line 244, in handle if self.convert(abs_srcpath, destpath): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/docs/checkouts/readthedocs.org/user_builds/deepmd/envs/latest/lib/python3.11/site-packages/sphinx/ext/imgconverter.py", line 67, in convert raise ExtensionError(__('convert exited with error:\n' sphinx.errors.ExtensionError: convert exited with error: [stderr] b"convert-im6.q16: non-conforming drawing primitive definition `l-1.744' @ error/draw.c/TracePath/6288.\nconvert-im6.q16: non-conforming drawing primitive definition `path' @ error/draw.c/RenderMVGContent/4301.\n" [stdout] b'' Extension error: convert exited with error: [stderr] b"convert-im6.q16: non-conforming drawing primitive definition `l-1.744' @ error/draw.c/TracePath/6288.\nconvert-im6.q16: non-conforming drawing primitive definition `path' @ error/draw.c/RenderMVGContent/4301.\n" [stdout] b'' ```
ImageMagick installed with Ubuntu/Debian does not include RSVG enabled by default. RSVG has to be enabled by compiling ImageMagick with
--with-rsvg=yes
with all of the various delegates configured and installed.(Seriously ImageMagick, why do you not have RSVG enabled...)
We are using fairly complex SVGs. Attached is one example (Download and change XML to SVG) https://hastebin.com/tavolodupe.xml
When compiling on RTD, we get a broken output such as black images. This is reproduced on my Ubuntu machine but running
magick convert
on my Windows machine gives the correct output.I'm in the process of creating a script to automate the installation of all the various delegates and ImageMagick, but this isn't feasible to deploy on RTD.
The text was updated successfully, but these errors were encountered: