godot
godot copied to clipboard
Crashes when Importing multiple SVG files at once or multicolored SVG files
Godot version
4.0
System information
Windows 11 22H2, GPU: Nvidia Mx330, CPU: intel core i5 10th gen, 12GB RAM
Issue description
When importing multiple SVG files at once or importing a multicolored SVG file, Godot 4.0 crashes. The problem then goes away when the project is reopened for multiple SVG files, but it still crashes when dealing with multicolored SVGs.
Steps to reproduce
Add a minimum of 30 monochrome SVG icons in a new project directory or one multicolored SVG file (e.g. Instagram logo) to recreate the issue.
Minimal reproduction project
"N/A"
Please attach a reproduction project with SVG files which trigger the crash. This is highly dependent on the content of the files you're using so we can't necessarily reproduce it without them.
I could not reproduce the crash. Removed .import
files and .godot
folder as well.. still cannot reproduce it.
Tested with current godot tip. All images in your zip folder and the 48x48px one you posted directly have no problems at all. The gigantic image is 88x88 meters (viewBox="0 0 333333 333333") takes a lot of time and memory (1GB). If you wait long enough, Godot doesn't crash...
WARNING: ImageLoaderSVG: Target canvas dimensions 333333×333333 (with scale 1.00)
exceed the max supported dimensions 16384×16384.
The target canvas will be scaled down.
at: create_image_from_utf8_buffer (modules/svg/image_loader_svg.cpp:87)
I usually leave Godot running without clicking on anything and it still crashes. I tested it on a different computer with no problems but when trying a third computer, the problem persisted. The two computers that had the issue had a minimum of 12GB of ram, the one without issues uses 32GB of ram. I would assume it may have to do with memory but I am not sure.
Try enabling Editor Settings>Interface/Editor/Single Window Mode, there are issues with external windows or look for windows crash issues. It doesn't look like SVG related to me. Under Linux it works fine.
This does look like it is simply just too much to handle. Rasterizing such a large image requires quite a lot of memory. I'm not sure if there is a practical need for this, but I doubt it. So I'm going to close this issue.