【问题标题】:Imagemagick svg conversionImagemagick svg 转换
【发布时间】:2012-05-29 07:17:25
【问题描述】:

我有一个 svg 文件,我想将其转换为 jpg/png。如果没有背景图像,问题是转换很好。但是当我尝试放置一些背景图像时,它不会在转换后的图像中呈现并显示纯背景色。

svg 的内容:

<svg height="370" version="1.1" width="350" xmlns="http://www.w3.org/2000/svg" style="overflow: hidden; position: relative; left: -0.5px;">
    <defs>
        <pattern id="38A07B9C-47E8-4E02-A005-E6E4443FE5D0" x="0" y="0" patternUnits="userSpaceOnUse" height="300" width="300" patternTransform="matrix(1,0,0,1,0,0) translate(0,20)">
            <image x="0" y="0" href="/home/mahad/public_html/svg/user-backgrounds/4f41f6a2a75dc_back.png" width="300" height="300"/>
        </pattern>
    </defs>
    <rect x="0" y="0" width="350" height="370" r="0" rx="0" ry="0" fill="#ffffff" stroke="none" style=""/>
    <rect x="0" y="20" width="350" height="350" r="0" rx="0" ry="0" fill="url(#38A07B9C-47E8-4E02-A005-E6E4443FE5D0)" stroke="none" style="fill: url(&quot;#38A07B9C-47E8-4E02-A005-E6E4443FE5D0&quot;) rgb(0, 0, 0); opacity: 0.38;" opacity="0.38"/>
    <rect x="0" y="20" width="14" height="14" r="0" rx="0" ry="0" fill="#000000" stroke="none" style=""/>
    <text style="text-anchor: middle; font: 12px &quot;Arial&quot;; opacity: 1;" x="100" y="100" text-anchor="middle" font="10px &quot;Arial&quot;" stroke="none" fill="#ff0000" font-size="12px" opacity="1" transform="matrix(1,0,0,1,73,92)">
        <tspan dy="4.5">helllloooo...</tspan>
    </text>
</svg>

转换命令: echo exec("/usr/bin/convert /home/public_html/qr.svg /home/public_html/qr.png");

请帮忙

【问题讨论】:

    标签: svg imagemagick


    【解决方案1】:

    就我而言,安装 librsvg2-bin 解决了问题:

    sudo apt-get install librsvg2-bin

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-08
      • 2013-06-26
      • 2012-11-21
      • 2014-02-08
      相关资源
      最近更新 更多