Skip to content
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

Closed
1 task done
ronsqae opened this issue Apr 5, 2022 · 11 comments
Closed
1 task done

Certain Inkscape SVG files do not preview #17527

ronsqae opened this issue Apr 5, 2022 · 11 comments
Assignees
Labels
Issue-Bug Something isn't working Product-File Explorer Power Toys that touch explorer like Preview Pane Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@ronsqae
Copy link

ronsqae commented Apr 5, 2022

Microsoft PowerToys version

0.57.0

Running as admin

  • Yes

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

@ronsqae ronsqae added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Apr 5, 2022
@Jay-o-Way Jay-o-Way added the Product-File Explorer Power Toys that touch explorer like Preview Pane label Apr 5, 2022
@Aaron-Junker Aaron-Junker self-assigned this Apr 5, 2022
@Aaron-Junker
Copy link
Collaborator

CC: @Aaron-Junker, sounds like something that can be fixed

I'll have a look

@jaimecbernardo
Copy link
Collaborator

jaimecbernardo commented Apr 13, 2022

#17588 Fixes this as well (Nevermind, example 2 is still showing text)

@ronsqae
Copy link
Author

ronsqae commented May 4, 2022

Still occurs in v0.58.0.

@hawkerm
Copy link

hawkerm commented Jun 7, 2022

Here's an example file which should demonstrates the issue (it did on 0.57 which I had just installed from the MS Store).

Gnu-

@stefansjfw stefansjfw self-assigned this Jun 14, 2022
@stefansjfw stefansjfw added Status-In progress This issue or work-item is under development Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed Status-In progress This issue or work-item is under development labels Jun 16, 2022
@jaimecbernardo jaimecbernardo added this to To do in 0.60 Release via automation Jun 24, 2022
@jaimecbernardo jaimecbernardo moved this from To do to Done in 0.60 Release Jun 24, 2022
@crutkas crutkas removed the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Jun 28, 2022
@ronsqae
Copy link
Author

ronsqae commented Jul 8, 2022

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.

@stefansjfw
Copy link
Collaborator

stefansjfw commented Jul 11, 2022

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 :)

@ronsqae
Copy link
Author

ronsqae commented Jul 12, 2022

@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. :)

example2-v0 60 0

@stefansjfw
Copy link
Collaborator

Why is the block comment not being ignored?

I didn't expect svg files to have such comments containing namespace declarations while working on a fix :)

Despite that, note that the fix has broken the icon preview, specifically for example2.svg

Ah right, I forgot to apply same fix to thumbnail previewer. On it...

@crutkas
Copy link
Member

crutkas commented Jul 22, 2022

We released 0.60.1 and this is included in it! https://aka.ms/installpowertoys. Thumbnail fix will be in 0.61

@robgazy
Copy link

robgazy commented Aug 19, 2022

Hi,
I'm not sure if I should open a new issue or if it is substantially related to this one.

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.

@crutkas
Copy link
Member

crutkas commented Aug 19, 2022

@robgazy please create a new issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Product-File Explorer Power Toys that touch explorer like Preview Pane Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
No open projects
Development

No branches or pull requests

8 participants