Created attachment 129847 [details] Simple svg that reproduces the issue SUMMARY Loading an SVG file that has a <defs> structure statement after another same level structure element, such as <g>, results in a broken import. Funny enough, the preview of recently open files will show the image just fine. These files work in Inkscape and the newest browsers just fine. Via the SVG spec these structure elements may be defined in any order at the same level which is typical of most xml schema and specs based off them. The Krita parser probably needs to do two separate passes of the DOM to work correctly. STEPS TO REPRODUCE 1. Open this fairly minimal reproduction 'repoBroken.svg' in Krita OBSERVED RESULT Notice no image is visible EXPECTED RESULT An image of two eye like shapes are visible. SOFTWARE/OS VERSIONS Windows: 10 64bit KDE Plasma Version: KDE Frameworks Version: Qt Version: Not sure ADDITIONAL INFORMATION If you edit the repoBroken.svg and move the <def> element above <g>, save, then open in Krita the expected result of an image of two eye like objects show up. Attached is repoBroken.svg.
Created attachment 129848 [details] This file is a working version of repoBroken where the def and g elements are swapped repoBroken.svg is the broken version and repoWorking.svg is the version where I moved the <defs /> element above the <g /> element on the same level that does load in Krita.
The preview is handled by Qt's svg support, while loading the file is done with our own svg parser. Thanks for the test file, I can reproduce the issue.