Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use RSVG as default delegate ImageMagick Ubuntu 16.04

I need to be using RSVG delegate for my conversions.

convert -list format | grep SVG
 MSVG  SVG       rw+   ImageMagick's own SVG internal renderer
  SVG  SVG       rw+   Scalable Vector Graphics (XML 2.9.3)
 SVGZ  SVG       rw+   Compressed Scalable Vector Graphics (XML 2.9.3)


identify -list delegate | grep "svg =" 
        svg =>          "rsvg-convert" -o "%o" "%i"

Any ideas how to set it to the default for convert?

like image 495
LukePOLO Avatar asked Jun 02 '16 17:06

LukePOLO


1 Answers

I made it work like this:

  • install RSVG on your system
  • configure and install ImageMagick from source with option --with-rsvg=yes

find more details here: https://gist.github.com/maxivak/1476f7e979879da9f75371a86d5627b5

  1. check imagemagick's support for svg
identify -list configure | grep svg

you should see something like this

DISTCHECK_CONFIG_FLAGS  --disable-deprecated  --with-quantum-depth=16  --with-jemalloc=no  --with-umem=no  --with-autotrace=no  --with-gslib=no  --with-fontpath=  --with-rsvg=no  --with-perl=no 

!NOTE! --with-rsvg=no which means that ImageMagick couldn't find rsvg in your system.

  1. install RSVG
sudo apt-get install librsvg2-bin

check rsvg works

rsvg-convert my.svg > my.png
  1. reinstall imagemagick from source with option '--with-rsvg=no'
# download
wget https://imagemagick.org/download/ImageMagick.tar.gz

# untar
tar xvzf ImageMagick.tar.gz

# 
cd ImageMagick-7.0.8

# !!! IMPORTANT. option `--with-srvg=yes` !!!

./configure --with-rsvg=yes

#
make

sudo make install

sudo ldconfig /usr/local/lib

  1. verify the ImageMagick install worked properly with SVG
/usr/local/bin/identify my.svg
like image 115
Max Ivak Avatar answered Oct 20 '22 21:10

Max Ivak