-
-
Notifications
You must be signed in to change notification settings - Fork 108
Description
Most appropriate sub-area of Processing 4?
IO ?
Processing version
4.4.7
Operating system
Windows/macOS/Linux
Bug description
Unable to load some SVG files, such as https://commons.wikimedia.org/wiki/File:Aiga_departingflights.svg you get something similar to:
ArrayIndexOutOfBoundsException: Index 43 out of bounds for length 43
Steps to reproduce this
-
Launch PDE, create a sketch, download https://commons.wikimedia.org/wiki/File:Aiga_departingflights.svg and add it to the
datafolder of your sketch. -
Run the snippet below:
void setup(){
size(500, 500);
PShape svg = loadShape("Aiga_departingflights.svg");
shape(svg); // will crash before this line...
}Additional context
This looks a bit like #750 but the "SVG path notation parsing issue" that causes it to fail seems different.
The provided failing SVG looks like this:
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 29 29">
<path d="m0 6 3-2 15 4 7-7a2 2 0 013 3l-7 7 4 15-2 3-7-13-5 5v4l-2 2-2-5-5-2 2-2h4l5-5z"/>
</svg>If you scale it a bit on Inkscape you get a different path notation and it works fine:
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 29 29">
<path d="m 0,5.9994379 2.9997,-1.9998 14.9985,3.9996 6.9993,-6.99930004 a 2.1211082,2.1211082 0 0 1 2.9997,2.99970004 l -6.9993,6.9993001 3.9996,14.9985 -1.9998,2.9997 -6.9993,-12.9987 -4.9995,4.9995 v 3.9996 l -1.9998,1.9998 -1.9998,-4.9995 -4.9995,-1.9998 1.9998,-1.9998 h 3.9996 l 4.9995,-4.9995 z"/>
</svg>Would you like to work on the issue?
No, I’m just reporting the issue