SVG with embedded images (with -Tsvg:cairo) won't open in image viewers

I’m trying to generate an SVG image from a DOT where there are JPG images to be embedded in the SVG. For some reason, if the file size gets too large (seems to be about 10MB), then I get an error when opening the SVG: “XML parse error: Error domain 1 code 77 on line 312 column 386623 of data: Premature end of data in tag defs line 3”

If I go to that part of the file, it’s just in the middle of the embedded image data. I’ve tried in image viewers, editors, etc and get the same message. Oddly, when I open the same file in a browser, it works fine.

I’m using -Tsvg:cairo to embed the images in the file. I’m not sure what other info might be relevant.

Does anyone know what the issue might be?

What program is giving you the error? Sounds like probably a problem with that program (not graphviz), if the file opens fine in a browser?

I first found this error on (fedora) linux using the default image viewer (literally called Image Viewer). I then tried opening in GIMP and got a very similar error (windows and linux). Then I wasn’t sure what other programs to try outside of browsers.

I’ve just thought of Inkscape so I’ve tried it and it loads fine. I guess those other programs just don’t support SVG too well?