dalibo / pandocker

🐳 A simple docker image for pandoc with filters, templates, fonts, and the latex bazaar
https://hub.docker.com/r/dalibo/pandocker/
BSD 3-Clause "New" or "Revised" License
143 stars 23 forks source link

rsvg-convert missing from 21.02 #213

Closed colindean closed 3 years ago

colindean commented 3 years ago

Describe the bug

20.02 and earlier had rsvg-convert, which something (pandoc or xelatex), needs to convert SVG. 21.02 does not have it.

$ docker run -it --rm --entrypoint bash dalibo/pandocker:20.02
root@b80c6e089c2b:/pandoc# command -v rsvg-convert
/usr/bin/rsvg-convert
root@b80c6e089c2b:/pandoc#
$ docker run -it --rm --entrypoint bash dalibo/pandocker:21.02
root@1e3eca8864e1:/pandoc# command -v rsvg-convert
root@1e3eca8864e1:/pandoc#

Steps To Reproduce

Convert a Markdown file that references an SVG image.

[WARNING] Could not convert image '/tmp/tex2pdf.-3d2f4ac3f30cd44a/a2bba2e68fa6fa402a11d0687787345f9786e291.svg': check that rsvg-convert is in path.
  rsvg-convert: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
[WARNING] Could not convert image '/tmp/tex2pdf.-3d2f4ac3f30cd44a/a2bba2e68fa6fa402a11d0687787345f9786e291.svg': check that rsvg-convert is in path.
  rsvg-convert: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
Error producing PDF.
! LaTeX Error: Cannot determine size of graphic in /tmp/tex2pdf.-3d2f4ac3f30cd4
4a/a2bba2e68fa6fa402a11d0687787345f9786e291.svg (no BoundingBox).

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.234 ...a2e68fa6fa402a11d0687787345f9786e291.svg}

make: *** [whitepaper-template-example.pdf] Error 43

Expected Behavior

pandocker's pandoc should handle SVG. It cannot do so without rsvg-convert being available.

colindean commented 3 years ago

Looks like this comes from librsvg2-bin on Debian Buster.

daamien commented 3 years ago

Hi @colindean

As this project is gaining new users, we receive more and more "feature" requests. We recently added support for Persian and CJK encodings. With these additions, the image went from 330MB to 810MB. We figured this would have a huge impact on a lot of users and on the many automatic CI pipelines.

We decided to "split" the image in 2 variants :

In this context, we decided that rsvg-convert would belong the buster-full variant.

$ docker run -it --rm --entrypoint rsvg-convert dalibo/pandocker:latest-full --version 
rsvg-convert version 2.44.10    

Let us know if it's possible for you to use the buster-full variant. The discussion remains open about what should be in the buster or in the buster-full variants... I don't have a strong opinion on rsvg-convert myself :-)

Also can you provide a basic example of a document with SVG conversion ?

colindean commented 3 years ago

For my particular use case, using buster-full isn't much of a hassle. I've already committed that on the few docs I manage until this ticket is resolved.

Unfortunately, it appears that rsvg-convert is required to use SVG images, and that error message above is about as user-friendly as it gets for knowing what's wrong.

doc.md:

# Lo and behold, an SVG, verily

![svg](bluesquare.svg)

bluesquare.svg:

<svg  xmlns="http://www.w3.org/2000/svg">
<!-- from http://tutorials.jenkov.com/svg/simple-svg-example.html -->
    <rect x="10" y="10" height="100" width="100"
          style="stroke:#ff0000; fill: #0000ff"/>
</svg>

My team uses SVG for all graphics except ones with text, and only because too often people use fonts that aren't included in the container. For graphics with text, we tell people to convert to PDF and version both the SVG and PDF. Fonts are a pain!