0

I am trying to render an SVG with 4000x4000 resolution. The command I am using is:

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

An svg sample is:

        <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>

The images are from 2MB - 24MB of size.

And in the end the thing crashes and gives me back "Segmentation fault".

If I do the same with a resolution of 1200x1200...

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

It works as expected.

Gabriel Stein
  • 428
  • 1
  • 4
  • 22

1 Answers1

0

The process simply hits the memory limit because there are a lot of high-res images referenced in the svg.

So the solution would be to get more memory or to use lower size images

Gabriel Stein
  • 428
  • 1
  • 4
  • 22