Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ubuntu ImageMagick在转换为png时未应用svg过滤器_Ubuntu_Svg_Imagemagick_Imagemagick Convert_Svg Filters - Fatal编程技术网

Ubuntu ImageMagick在转换为png时未应用svg过滤器

Ubuntu ImageMagick在转换为png时未应用svg过滤器,ubuntu,svg,imagemagick,imagemagick-convert,svg-filters,Ubuntu,Svg,Imagemagick,Imagemagick Convert,Svg Filters,有人能帮我找出这个问题吗。考虑这个SVG标记。 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="446.5 158 967 368"> <defs> <filter color-interpolation-filters="sRGB" id="

有人能帮我找出这个问题吗。考虑这个SVG标记。

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="446.5 158 967 368">
    <defs>
        <filter color-interpolation-filters="sRGB" id="Sil2df3ui1g5" filterUnits="userSpaceOnUse">
            <feGaussianBlur stdDeviation="2" in="SourceAlpha"/>
            <feOffset result="offsetblur" dy="10" dx="10"/>
            <feFlood flood-color="orange"/>
            <feComposite operator="in" in2="offsetblur"/>
            <feComponentTransfer>
                <feFuncA slope="1" type="linear"/>
            </feComponentTransfer>
            <feMerge>
                <feMergeNode/>
                <feMergeNode in="SourceGraphic"/>
            </feMerge>
        </filter>
    </defs>
    <g>
        <g>
            <text stroke="#8f02d0" id="fsjd" fill="#00a7f2" transform="matrix(2.39,0,0,2.39,-1280.19,-438.545)" style="font-size: 60px; text-anchor: middle; stroke-linejoin: round; filter:url('#Sil2df3ui1g5'); font-weight: 400; font-style: normal; letter-spacing: 0px; stroke-width: 2;" y="333" x="921">Lorem</text>
            <text transform="matrix(1,0,0,1,-398,-145)" fill="#dd0000" style="font-size: 32px; text-anchor: middle; font-family: Ubuntu; font-style: normal; font-weight: 400; letter-spacing: 0px;" y="333" x="921">Safe Mode</text>
            <text transform="matrix(1,0,0,1,416,185)" fill="#179c00" style="font-size: 32px; text-anchor: middle; font-family: Ubuntu; font-style: normal; font-weight: 400; letter-spacing: 0px;" y="333" x="921">Safe Mode</text>
        </g>
    </g>
</svg>
未应用过滤器


但是,如果我使用任何其他svg(由Inkscape/AI等生成),它将成功转换。我猜SVG标记有问题。

如果为过滤器指定IRI,请不要使用单引号

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="446.5 158 967 368">
    <defs>
        <filter color-interpolation-filters="sRGB" id="Sil2df3ui1g5" filterUnits="userSpaceOnUse">
            <feGaussianBlur stdDeviation="2" in="SourceAlpha"/>
            <feOffset result="offsetblur" dy="10" dx="10"/>
            <feFlood flood-color="orange"/>
            <feComposite operator="in" in2="offsetblur"/>
            <feComponentTransfer>
                <feFuncA slope="1" type="linear"/>
            </feComponentTransfer>
            <feMerge>
                <feMergeNode/>
                <feMergeNode in="SourceGraphic"/>
            </feMerge>
        </filter>
    </defs>
    <g>
        <g>
            <text stroke="#8f02d0" id="fsjd" fill="#00a7f2" transform="matrix(2.39,0,0,2.39,-1280.19,-438.545)" style="font-size: 60px; text-anchor: middle; stroke-linejoin: round; filter:url('#Sil2df3ui1g5'); font-weight: 400; font-style: normal; letter-spacing: 0px; stroke-width: 2;" y="333" x="921">Lorem</text>
            <text transform="matrix(1,0,0,1,-398,-145)" fill="#dd0000" style="font-size: 32px; text-anchor: middle; font-family: Ubuntu; font-style: normal; font-weight: 400; letter-spacing: 0px;" y="333" x="921">Safe Mode</text>
            <text transform="matrix(1,0,0,1,416,185)" fill="#179c00" style="font-size: 32px; text-anchor: middle; font-family: Ubuntu; font-style: normal; font-weight: 400; letter-spacing: 0px;" y="333" x="921">Safe Mode</text>
        </g>
    </g>
</svg>
改变这个

filter:url('#Sil2df3ui1g5');

至少在我的机器上,这解决了问题


根据W3C验证器,单引号应该可以,看起来像ImageMagick中的一个bug。

也遇到了同样的问题,我没有想到要删除这些引号,太感谢了!
filter:url(#Sil2df3ui1g5);