PShape SVG error
in
Core Library Questions
•
1 year ago
Hi all!
I'm trying to recreate the photography "vignetting" effect using a svg created in Illustrator but when I try to load it in setup() I receive the following error:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at processing.core.PShapeSVG$Gradient.<init>(PShapeSVG.java:1267)
at processing.core.PShapeSVG$RadialGradient.<init>(PShapeSVG.java:1328)
at processing.core.PShapeSVG.parseChild(PShapeSVG.java:370)
at processing.core.PShapeSVG.parseChildren(PShapeSVG.java:299)
at processing.core.PShapeSVG.<init>(PShapeSVG.java:288)
at processing.core.PShapeSVG.<init>(PShapeSVG.java:174)
at processing.core.PShapeSVG.<init>(PShapeSVG.java:166)
at processing.core.PApplet.loadShape(Unknown Source)
at processing.core.PApplet.loadShape(Unknown Source)
If I change the svg image, using other images that I've used before with success, I don't receive this error... any idea?
This is the content of the svg file:
Thanks!
I'm trying to recreate the photography "vignetting" effect using a svg created in Illustrator but when I try to load it in setup() I receive the following error:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at processing.core.PShapeSVG$Gradient.<init>(PShapeSVG.java:1267)
at processing.core.PShapeSVG$RadialGradient.<init>(PShapeSVG.java:1328)
at processing.core.PShapeSVG.parseChild(PShapeSVG.java:370)
at processing.core.PShapeSVG.parseChildren(PShapeSVG.java:299)
at processing.core.PShapeSVG.<init>(PShapeSVG.java:288)
at processing.core.PShapeSVG.<init>(PShapeSVG.java:174)
at processing.core.PShapeSVG.<init>(PShapeSVG.java:166)
at processing.core.PApplet.loadShape(Unknown Source)
at processing.core.PApplet.loadShape(Unknown Source)
If I change the svg image, using other images that I've used before with success, I don't receive this error... any idea?
This is the content of the svg file:
- <?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="141.73px" height="141.73px" viewBox="0 0 141.73 141.73" enable-background="new 0 0 141.73 141.73" xml:space="preserve">
<radialGradient id="SVGID_1_" cx="70.8662" cy="70.8662" r="70.8662" gradientUnits="userSpaceOnUse">
<stop offset="0" style="stop-color:#000000;stop-opacity:0"/>
<stop offset="0.8587" style="stop-color:#000000;stop-opacity:0.4293"/>
<stop offset="1" style="stop-color:#000000;stop-opacity:0.5"/>
</radialGradient>
<rect y="0" fill="url(#SVGID_1_)" width="141.732" height="141.733"/>
</svg>
Thanks!
1