4

I need to do some SVG manipulation, specifically create PNG thumbnails from SVG icons. This works fine when running the site through MAMP, but not when running it through DDEV.

When running convert -list configure it justs it as --without-rsvg, which I assume means it doesn't configure imagemagick to run with rsvg support. It also does not list SVG as a supported format when running convert -list format.

As explained by Randy Fay, DDEV's web container runs as a Debian Stretch, so while the question is specifically for DDEV, it can also be relevant to enabling support on Debian Stretch containers in general.

Question: How to I enable SVG support for Imagemagick?

Community
  • 1
  • 1
Dion S. Jensen
  • 167
  • 2
  • 14
  • 2
    This is actually a fairly generic Debian question, so could you edit just a bit to mention that it's a Debian Stretch container? I added the tags. – rfay Dec 17 '19 at 14:04

2 Answers2

3

After some chat with Randy Fay on slack, he suggested adding the following to my config.yaml

webimage_extra_packages: [libmagickcore-dev]

After doing that and a restart of the projet, it adds SVG support and everything now works as expected.

This was a very quick fix, so many thanks to Randy Fay for helping out.

Dion S. Jensen
  • 167
  • 2
  • 14
  • 1
    For those that might be trying to solve the generic Debian problem, could you add "This is the same as `apt-get update && apt-get install libmagickcore-dev`, but ddev does that part." or something like that. – rfay Dec 17 '19 at 14:05
3

Actually, it's enough to install the libmagickcore-6.q16-6-extra package, which adds support for SVG to imagemagick (cf. apt show libmagickcore-6.q16-6-extra). It solves the problem both for convert command and php-imagick PHP module.

Fabien
  • 31
  • 1