Freezes when trying to pull in a SVG

I have an SVG file I want to pull in and when I drag and drop in on the page Ignition seems to freeze (constant loading circle showing).

  1. What would make this happen?
  2. How can I get the SVG to work?

Can you attach the SVG or email it to support?

Ignition’s SVG parsing library doesn’t handle all SVGs or their element types, so we’ll need to see what’s going wrong.

Ok so I pulled up the diagnostics console to see what is causing the error and I get the following message.

[color=#FF0040]Exception in thread “AWT-EventQueue-2” org.apache.batik.bridge.BridgeException: null:-1
The URI "data:image/png;base64,

…long data section…

on element can’t be opened because:
URL data in unsupported format or corrupt
at org.apache.batik.bridge.UserAgentAdapter.getBrokenLinkDocument(UserAgentAdapter.java:449)
at org.apache.batik.bridge.SVGImageElementBridge.createRasterImageNode(SVGImageElementBridge.java:604)
at org.apache.batik.bridge.SVGImageElementBridge.createImageGraphicsNode(SVGImageElementBridge.java:327)
at org.apache.batik.bridge.SVGImageElementBridge.buildImageGraphicsNode(SVGImageElementBridge.java:177)
at org.apache.batik.bridge.SVGImageElementBridge.createGraphicsNode(SVGImageElementBridge.java:119)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:213)
at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:219)
at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)
at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82)
at com.inductiveautomation.factorypmi.designer.workspace.DropHandler$SVGImporter.parseSvg(DropHandler.java:314)
at com.inductiveautomation.factorypmi.designer.workspace.DropHandler$SVGImporter.run(DropHandler.java:329)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)[/color]

I have also attached a .txt file to show the console printout more easily.

Let me know if you need any other help or files to debug the problem.
SVG console Error Message.txt (2.16 KB)

So is the solution just not to use an SVG? Or are you still working on a fix?

It looks like the problem is the SVG you’re trying to use contains a link to a raster image and that link/image can’t be loaded. I’ll have to run it by Carl to make sure that’s what’s going on. I’m not sure if it’s blowing up because the image can’t be loaded, because embedded links aren’t supported, or because embedded images aren’t supported; I’ll find out.

If you could attach or email the SVG in question that might help as well.

Just to echo Kevin’s sentiment: please send us the SVG in question.

Ok I am trying to attach the file to send it to you and when I click “add the file” below it says “the extension SVG is not allowed” so how would you like me to send it to you? Email?

You can email it to support@inductiveautomation.com. If it’s too large or gets blocked maybe you can zip it first?

Alright, we looked at your SVG and apparently it’s nothing but an embedded base64 encoded PNG. I guess our SVG renderer doesn’t support this case, but since there’s absolutely nothing else to your SVG maybe you can just take whatever the raster image is supposed to be and import that instead.

For now just using the original PNG will work. I was just hoping to use SVGs in case future scaling would cause pixelated images. Let me know if the next update handles this case.

Even if the SVG renderer supported it, your embedded raster image won’t magically start scaling nicely. If you want something that scales nicely it has to actually be a vector-based image.