2

I have a big SVG file (~200MB): it's a graph with very precise data. However when gzipped into graph.svgz its size is around 3 MB, so you see it's very repetitive data.

When I attempt to open it, Inkscape hangs and fills up the RAM, the only exit is reboot REISUB. I use Debian 10 with KDE desktop.

Any idea to view the image ? It's OK to use another tool than inkscape, but I need to view the chart in detail, so generating a postage-stamp-sized PNG is not a good solution.

Jonas Stein
  • 3,898
  • 4
  • 34
  • 55
color2v
  • 111
  • 1
  • 6
  • Please add to your question what OS are you running and what is REISUB is. – bitinerant May 20 '20 at 18:01
  • REISUB is linux kernel safe reboot, see https://en.wikipedia.org/wiki/Reisub – color2v May 20 '20 at 18:03
  • Have you tried the various export options like `--export-pdf=FILENAME` or `--export-plain-svg=FILENAME`? – Freddy May 20 '20 at 18:55
  • Have you tried Inkscape without the GUI? It might require less RAM. `inkscape --without-gui --export-height=1024 big_file.svg --export-png=big_file.png` – bitinerant May 20 '20 at 18:57
  • Same behavior, it fills up RAM, then fills up swap, then freezes the computer. It stopped it before it did so. – color2v May 20 '20 at 19:41

3 Answers3

2

Eye of Gnome, as of version 3.36.2 on Ubuntu 20.04, is able to render svgz files. Didn't test on any other version. Could be used as an alternative to inkscape to view svgz files.

The gnome project develops and uses rsvg as its svg renderer (reference), which is supposed to be at least CPU efficient as this benchmark suggests.

Debian/Ubuntu install:

sudo apt install eog

RedHat/CentOS install:

sudo yum install eog

Fedora install:

sudo dnf install eog
Zip
  • 962
  • 6
  • 16
  • I tried with Eye of GNOME, the program terminates with an error "unable to load image..." – color2v May 20 '20 at 22:26
  • That may mean that the lib behind eog to render this file is the same as inkscape, or that the file is "damaged/defect", or perhaps that it is happening to trigger a similar bug on both... Can you validate, perhapes, on windows, illustrator or other software if the file will open? – Zip May 21 '20 at 02:54
  • I don't think the file is corrupted, when I generate a graph the same way with less data it opens well with inkscape. Also, my file manager generate a thumbnail. – color2v May 21 '20 at 07:46
  • I don't have a Windows computer, but I think the size is a problem. A 200MB SVG is too big, maybea special tool is needed to view it? – color2v May 21 '20 at 08:59
  • The svgz is just a gzipped svg. Are you able to view it on inkscape if it's not compressed? An svgz file took more RAM to load than an svg for me. I've produced an 11 MB svg from examples found [here](https://www.mediawiki.org/wiki/SVG_benchmarks), which compressed to 3.4MB as a plain svgz. Inkscape loads it with 457 MB of RAM. Without any opened files it consumes 67MB of RAM, which leaves 382MB to the file rendering. Can't say if this is actually a linear grow, but I estimate it needs about 7GB of RAM to render a 200MB vector. Do you actually have this amount of free RAM? – Zip May 21 '20 at 16:21
  • I know about svgz, I gzipped it myself. I currently have 16GB RAM, but I don't think it's linear because inkscape fills up the whole RAM *and* the additional 16GB swap. Thanks for the link anyway. I'm testing it with another PC with a good graphics card, maybe it will work... – color2v May 21 '20 at 20:11
  • So I did a test, both the SVG and the SVGZ triggered the same behavior on my computer with 16GB RAM and 8GB GDDR6. I think Inkscape doesn't rely on graphics card. – color2v May 21 '20 at 20:37
1

Try Chrome/Firefox if all else fails. It was able to render my 111 MB SVG without breaking a sweat where viewers and editors like Nomacs and GIMP failed.

-1

You can view huge .gz files with zless. From the man page:

Zless is a filter which allows examination of compressed or plain text files one screenful at a time on a soft-copy terminal. It is the equivalent of setting the environment variable LESSOPEN to '|gzip -cdfq -- %s', and the environment variable LESSMETACHARS to ';*?"()<>[|&^`#\$%=~', and then running less. However, enough people seem to think that having the command zless available is important to be worth providing it.

bitinerant
  • 784
  • 4
  • 14