我正在尝试渲染一个分辨率为4000x4000的SVG。我使用的命令是:
rsvg --keep-image-data -w 4000 -h 4000 big.svg try.pngsvg示例如下:
<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不等。
最后,它崩溃了,并返回给我“分割错误”。
如果我用1200x1200的分辨率做同样的事情...
rsvg --keep-image-data -w 1200 -h 1200 big.svg try.png它的工作方式与预期一致。
发布于 2017-04-13 22:40:06
由于svg中引用了大量高分辨率图像,因此该过程将达到内存限制。
因此,解决方案将是获得更多内存或使用较小尺寸的图像
https://stackoverflow.com/questions/43392719
复制相似问题