-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing SVG with no width, height, or viewport doesn't work #684
Comments
Is this referring to big SVGs, or some non-svg file with an erroneous SVG extension? Also, is there a crash, eternal freeze, or will it load if you wait long enough? If there's a crash, we can use the CRASH notification - if there's a crash before READY is finished, then add a "program_crashed_last_time" sort of thing to the save data. On next launch, show a dialog asking if you want to try to load the SVG text and its path again, or start completely fresh. But if there's no actual crash, just an eternal freeze, the above is useless, so we're just back to optimizing. |
I would suggest just adding a timeout for loading an SVG for now so that people can still use the software. This can be removed once optimization is good enough. |
Also, it is from Kenney assets, it is a regular SVG file with a .svg extension, and it will not load if I wait long enough. I do like your idea of showing a dialog when it's launched. I do kind of need to short-term fix it so is there a way to do it through files? |
Could you post the SVG text here by the way? I'd like to inspect if there are any outstanding issues in our processing of this particular graphic. |
Depends on your OS, but you can find GodSVG's user data and go to save.tres, simply clear the svg_text field. For example on Linux, that's in Home/.local/share/GodSVG. For other operating systems, I don't know. |
It is the "vector_objects.svg" file from Kenney's Racing Pack. (https://kenney.nl/assets/racing-pack) |
Figured out a possible culprit. The SVG in question has neither width and height, nor a viewBox. Our editor breaks in multiple ways in this scenario, in fact, I kinda thought SVGs like these were just illegal. But it seems like we should instead implement this as some sort of "infinite canvas mode". |
I changed the title to better reflect the issue. |
The occasional crash probably still had to do with the weight of our UI or other things, but yeah there is definitely a problem here too. |
PSA - if the graphic froze GodSVG because of how much memory it required, the situation should be a little better now, mainly thanks to: #694 This doesn't resolve any underlying issues, it just addresses something that commonly made UIs intensive. |
That's interesting. The logic around zero-size files needs to be refined, this is actually a necessary fix before alpha 4. I think it no longer crashes because of some commits that improved GodSVG's memory usage by reducing the number of nodes. |
Yeah, but how does it show no editor? |
Ow, I didn't understand the screenshot. I have no idea, but I'll for sure take on this bug this week. It's the 2nd highest priority right now. |
If you import an SVG that is too big for GodSVG to handle, it will save that file path and try to load it. This makes the program forever unusable on the computer.
The text was updated successfully, but these errors were encountered: