Skip to content

Some SVG features aren't supported for SVG app icons #92

Open

Description

@deansheather

Embedded bitmaps

Some SVG files are actually PNGs masquerading as SVGs.

Take for example /icon/cursor.svg in Coder:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="36" height="36" fill="none">
  <path fill="url(#a)" d="M0 0h36v36H0z"/>
  <defs>
    <pattern id="a" width="1" height="1" patternContentUnits="objectBoundingBox">
      <use xlink:href="#b" transform="scale(.0005)"/>
    </pattern>
    <image xlink:href="data:image/png;base64,iVBOR..." id="b" width="2000" height="2000"/>
  </defs>
</svg>

WinUI 3's SvgImageSource doesn't seem to be able to render <image> tags like these in SVGs, so cursor.svg shows up as blank.

There's no way to detect that it failed to render as it fails silently.

VS Code Icon gradient

The VS Code icon /icon/code.svg has a weird white gradient over it in the app that doesn't appear when viewing the SVG in a web browser.

Image


We could fix all of the SVGs in Coder and just declare that the desktop app for windows can't render icons like these somewhere in our documentation or something, or we could parse the SVG to look for these tags and try to render as a BitmapImage instead.

Relates to #91

Activity

  1. changed the title [-]SVG app icons don't support embedded bitmap images[/-] [+]Some SVG features aren't supported for SVG app icons[/+] on May 8, 2025
  2. added theissue type on May 28, 2025
  3. deansheather commented on Jun 6, 2025

    @deansheather
    CollaboratorAuthor

    cursor.svg was fixed by fixing it in Coder, but our code still doesn't support SVGs with image tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions