readthedocs/readthedocs-docker-images

Compile ImageMagick with the RSVG delegate enabled

Closed this issue · 9 comments

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.

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.

Okay, an easier solution is to install Inkscape as ImageMagick will use that if installed.

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.

ImageMagick6 for Ubuntu does not include RSVG delegate, and the internal SVG delegate seems to give poor accuracy for any SVG I give it.

image

Would it be possible for this package to exist on a per build/project basis?

amotl commented

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 sphinxcontrib-svg2pdfconverter as outlined at earthobservations/wetterdienst#155 (comment), updating the ImageMagick installation will nevertheless make sense.

Most probably, some things will resolve after merging #137.

With kind regards,
Andreas.

Edit: We had no luck even after moving on to sphinxcontrib.rsvgconverter, see earthobservations/wetterdienst#155 (comment).

Most probably, some things will resolve after merging #137.

@amotl I'm targeting deploying that PR under a testing docker image next week. I'll write a comment here if everything goes smooth asking you for test the new docker image with Ubuntu 20.04 LTS.

Okay, an easier solution is to install Inkscape as ImageMagick will use that if installed.

It seems that this issue still exists in 2024. To install Inkscape, one can add inkscape to build.apt_packages:

build:
  apt_packages:
    - inkscape

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.