zenozeng/p5.js-svg

Large exports fail on Firefox

seanmpuckett opened this issue · 1 comments

SVG saves of significant size (>20mb?) on Firefox seem to fail because of limitations of the size of encoded URLs? Probably should try to use a blob to create the download rather than a URL. Big exports work ok on Chrome and Safari as-is although it's really slow. Firefox is a better p5 platform than the others because of its rendering speed and accuracy, so it would be great to get this sorted soon.

May I ask if you have called the 'clear' method? Since SVG is XML-based, every call of the draw function will insert elements into it, and these elements keep existing even if they are not visible. So, long-time running will result in too many child elements. It's recommend to call clear() in your draw function, which will trigger internal context.__clearCanvas() to remove elements.

function draw() {
  clear();
  // draw
}

See #32

If the issue is not resolved, feel free to reopen it.