Librsvg分段错误 - 许多图像大约10MB

时间:2017-04-13 12:45:31

标签: librsvg

我正在尝试使用4000x4000分辨率渲染SVG。 我正在使用的命令是:

rsvg --keep-image-data -w 4000 -h 4000 big.svg try.png

svg样本是:

        <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="406" height="406">
           <clipPath id="slot-1">
              <rect x="0" y="0" width="45" height="45" />
           </clipPath>
           <clipPath id="slot-2">
              <rect x="0" y="203" width="45" height="45" />
           </clipPath>
           <image clip-path="url(#slot-2)" x="1" y="170" angle="0" width="80" height="45" preserveAspectRatio="none" xlink:href="file:///var/www/myposter/web/application/../../storage/public/2017/04/0/b/f/8/4/0bf841426d859a99b0736766eca9d353ad9c9fd2_base.jpg" />
           <image clip-path="url(#slot-1)" x="1" y="-29" angle="0" width="76" height="45" preserveAspectRatio="none" xlink:href="file:///var/www/myposter/web/application/../../storage/public/2017/04/1/0/9/6/0/10960d9aa853b49dac548887595c829b32aa5107_base.jpg" />
        </svg>

图像大小为2MB - 24MB。

最后,事情崩溃并让我回来了#34;分段错误&#34;。

如果我这样做,分辨率为1200x1200 ......

rsvg --keep-image-data -w 1200 -h 1200 big.svg try.png

它按预期工作。

1 个答案:

答案 0 :(得分:0)

该过程只是达到内存限制,因为svg中引用了很多高分辨率图像。

所以解决方案是获得更多内存或使用更小尺寸的图像