-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Certain Inkscape SVG files do not preview #17527
Comments
I'll have a look |
#17588 Fixes this as well (Nevermind, example 2 is still showing text) |
Still occurs in v0.58.0. |
I just installed v0.60. Using the files in examples.zip attached to my original post, example2.svg now previews correctly but now example3.svg displays text instead of the image. By following the same instructions in that post, swapping the two lines back to their original order, the preview will display. |
@ronsqae The fix for this was basically what you described - manually switch places of namespace declaration inside svg file (without changing original file of course). So, what's the issue with example3.svg ? Your comment inside the file describing the issue :) As it contains same namespace declarations that we look for to switch places, it breaks our fix logic :D I didn't expect svg files to have such comments while working on a fix :) If you just delete the comment from example3.svg file, it should be previewed correctly :) |
@stefansjfw Interesting. Yes, deleting the block comment does allow the preview to display. Why is the block comment not being ignored? Despite that, note that the fix has broken the icon preview, specifically for example2.svg. It now displays text instead of the image the same as the preview was doing. (If icons are cached, open the file and force a save to rebuild the icon.) If I manually swap the xmlns:svg to above the xmlns line, the icon displays correctly. :) |
I didn't expect svg files to have such comments containing namespace declarations while working on a fix :)
Ah right, I forgot to apply same fix to thumbnail previewer. On it... |
We released 0.60.1 and this is included in it! https://aka.ms/installpowertoys. Thumbnail fix will be in 0.61 |
Hi, With the default export from Inkscape I am seeing the thumbnail OK, but the preview pane shows an extremely large representation of the .svg. If I re-save the file as optimized the preview pane looks fine. |
@robgazy please create a new issue |
Microsoft PowerToys version
0.57.0
Running as admin
Area(s) with issue?
SVG Preview
Steps to reproduce
SVG files created with Inkscape 1.1 and newer show text instead of the image in the preview pane. Files created with older versions of Inkscape preview just fine. I have included 3 small example svg files in the attached zip.
The trigger is the existence of the xmlns:svg line, and it's position, in the <svg> section.
example1.svg
Created with Inkscape v1.0, displays fine in the preview pane.
example2.svg
This is the same image but created with Inkscape v1.1. When comparing the <svg> (and other) sections, notice that the items within those sections are in the reverse order of those created with Inkscape v1.0, which shouldn't matter based on what I read in the SVG specifications.
For this file, the preview pane shows 2 lines of text instead of the image:
Example 2 SVG
Example 2
example3.svg
By swapping 2 lines in the <svg> section, the image will display in the preview pane.
I used Notepad++ to edit the file and swapped the order of these 2 lines:
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
to:
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
and the image displayed in the preview pane immediately after saving the file. Swap the lines back, save the file, and the text will display again instead of the image.
The image will also display if I simply delete xmlns:svg line from the <svg> section:
Starting with the 0.57.0 version, I worked backwards and installed the previous versions of PowerToys and found that this behavior was introduced in PowerToys v0.33.1. In v0.31.2, all three files show the image in the preview pane.
examples.zip
✔️ Expected Behavior
All Inkscape SVG files to display in the preview pane.
❌ Actual Behavior
Text was displayed in the preview pane.
Other Software
No response
The text was updated successfully, but these errors were encountered: