简体   繁体   English

使用RSVG作为默认委托ImageMagick Ubuntu 16.04

[英]Use RSVG as default delegate ImageMagick Ubuntu 16.04

I need to be using RSVG delegate for my conversions. 我需要使用RSVG委托进行转换。

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? 任何想法如何将其设置为默认转换?

I made it work like this: 我使它像这样工作:

  • install RSVG on your system 在系统上安装RSVG
  • configure and install ImageMagick from source with option --with-rsvg=yes 使用选项--with-rsvg=yes从源配置和安装ImageMagick

find more details here: https://gist.github.com/maxivak/1476f7e979879da9f75371a86d5627b5 在此处找到更多详细信息: https : //gist.github.com/maxivak/1476f7e979879da9f75371a86d5627b5

  1. check imagemagick's support for svg 检查imagemagick对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. --with-rsvg=no这意味着ImageMagick在您的系统中找不到rsvg。

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

check rsvg works 检查rsvg作品

rsvg-convert my.svg > my.png
  1. reinstall imagemagick from source with option '--with-rsvg=no' 使用选项'--with-rsvg = no'从源代码重新安装imagemagick
# 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 验证ImageMagick安装是否可以与SVG一起正常使用
/usr/local/bin/identify my.svg

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM