Description
Most appropriate sub-area of Processing 4?
Image
Processing version
4.3
Operating system
Linux
Steps to reproduce this
"1. Create a new sketch and put https://github.com/yeyushengfan258/Win11-icon-theme/blob/main/src/mimes/48/application-x-executable.svg into data
folder.
-
Enter the code in the MWE below and Run.
-
Got
RuntimeException: shape command not handled: e-4
."
snippet
PShape shapeIconExe;
void setup() {
shapeIconExe = loadShape("application-x-executable.svg");
}
void draw() {
shape(shapeIconExe, 0, 0, 48, 48);
}
Additional context
The scientific notation 3.4e-4
for 0.00034
in the SVG file causes the error.
Glancing at PShapeSVG::parsePath
in core/src/processing/core/PShapeSVG.java
, the parser does not seem to handle the scientific notation, though the SVG grammar specification (https://www.w3.org/1999/08/WD-SVG-19990812/paths.html#PathDataBNF) explicitly allows it.
I would really appreciate it if Processing is capable of loading such SVG files.
I found several Forum Post mentioning the problem too (e.g.~https://discourse.processing.org/t/shape-command-not-handled-e-4/44894).
Workaround is to edit SVG to fix the scientific notation to the ordinary decimal by hand or scripts.
This may, however, cause License issues especially when one considers re-distribution, so fixing core seems ideal IMHO.