Library / SDK
ThioJoe/win-svg-thumbs-rust avatar
ThioJoe/win-svg-thumbs-rust

win-svg-thumbs-rust renders SVG thumbnails with Direct2D and nothing else

A native Windows SVG thumbnail handler for File Explorer that uses only the Windows API, written in Rust.

606 stars13 forksRustMIT

At a glance

What is it?
ThioJoe/win-svg-thumbs-rust is an MIT licensed Rust shell extension that gives Windows Explorer thumbnails for .svg and .svgz files by rendering them with the Direct2D API directly, with no third party rendering library and no dependency outside the official Microsoft windows-rs crates. The README is also candid about the SVGs it cannot draw and about the two things a Windows extension must never do, crash Explorer and render black.
Who is it for?
Adopt win-svg-thumbs-rust if you work with SVG assets on Windows and want Explorer to preview them without installing a full graphics toolchain, because the extension uses only the Windows API and ships as a signed installer. Do not adopt it if your artwork relies on features Direct2D does not implement, since the README states that some SVGs render as black squares and that text glyphs are not supported.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 87 days ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A thumbnail provider that draws with the system graphics stack

The project is a high-performance thumbnail provider for Windows that generates Explorer thumbnails for .svg and .svgz files, written in Rust with no third party dependencies. Two design choices carry the argument the README makes. The first is that it is built using only official Microsoft-published Rust crates, found in the windows-rs repository, so there is no unknown code pulled in from an endless tree of dependencies. The second is that it renders purely via the Windows API, with no separate third party library files that may go out of date or add overhead. The rendering stack is Direct2D, the system graphics API, and the result is delivered to Explorer in the format Explorer expects. The third point in the README is about trust rather than performance. The binary is signed via Azure Trusted Signing, which requires rigorous verification of real-world identity, and the stated purpose is to prove the extension is not made by an unaccountable or unknown developer, which is a reasonable thing to want from code that runs inside Explorer.

Installing is one winget command or an MSI

There are two supported routes and they are both short. The first is WinGet, which downloads and runs the installer:

bash
winget install ThioJoe.SvgThumbnailExtension

The second is to go to the releases page, find the .msi installer under Assets, download it and run it, after which Windows Explorer will automatically use the provider for .svg and .svgz files. One instruction in the README is easy to miss and matters in practice. After installing, be sure to disable any other SVG thumbnail extensions which may interfere, like the one from PowerToys. Two providers registered for the same file type is a real conflict on Windows, and the symptom is a thumbnail that never appears rather than an error. Uninstalling is unremarkable, since it can be uninstalled like any other app in the Windows Installed Apps list.

Registering the DLL by hand, and the permission it needs

For people who do not want the MSI, the README documents manual registration. You download the latest win_svg_thumbs.dll from the releases page, and for security you place it somewhere that requires admin access to write, such as making a folder in C:\Program Files. Then you open a Command Prompt with administrator privileges, change to that directory and register the DLL:

bash
    regsvr32 win_svg_thumbs.dll

The administrator requirement is not a formality, and the README says what happens if you skip it, an error 0x80004005 for lack of permission. Removing it later is the mirror image, run in an administrator Command Prompt:

bash
  regsvr32 /u win_svg_thumbs.dll

The advice to place the DLL somewhere that requires admin access to write is the interesting part. A shell extension is loaded into every Explorer process that browses a folder containing matching files, so the file on disk is a code injection surface, and putting it under Program Files means a non-administrator cannot replace it. That reasoning is the same one behind the signing decision, and it is why the manual path is documented with a security instruction rather than just a command.

CSS blocks are pre-processed by hand because Direct2D cannot read them

The technical section is where the real work is, and the first step is the least obvious. When Explorer needs a thumbnail for an .svg file, it hands the file's data to the DLL as a stream, and the provider reads the whole stream into memory. Then the SVG data is pre-processed. The reason is that the API does not support CSS style blocks within a separate dedicated def block, or at the top level, so the script does some pre-processing on the XML to make such SVGs look correct. It uses the MSXML Windows API to look for style tags that apply styles to classes or named attributes, and then, because the Direct2D API does support in-line style strings, the code does some rudimentary CSS parsing and applies the styles to each individual element, also using MSXML, before passing it on. That is a real CSS subset implementation, written to work around a specific gap in the platform, and it is the part of the code that would break first if a file used a CSS feature the parser does not understand.

Direct2D renders, then an unpremultiply makes GDI accept the result

The rendering pipeline is described step by step, and the details are the reason the extension can be both fast and correct. The provider uses Direct2D for high-performance, hardware-accelerated rendering, first creating a GPU-based bitmap as the render target. The Direct2D API turns the SVG data into an SvgDocument object, and the viewport attribute is set to the thumbnail size requested by Explorer. A fun fact is included: though undocumented, the Direct2D API also accepts .svgz data, which is simply gzip-compressed SVG data. The width and height attributes are removed from the root svg element before drawing, which the author discovered causes the DrawSvgDocument method to autoscale the image to the viewport and avoids manual scaling. The document is drawn onto the render target bitmap, and then the unpremultiply effect is applied, because the standard Windows GDI requires straight alpha, and the un-premultiplication step is necessary for displaying transparency correctly and prevents dark edges from appearing. The rendered image is copied from the GPU render target to a staging bitmap on the CPU so the program can access the raw pixel data, in 32-bit BGRA format with straight alpha. A standard Windows GDI HBITMAP is then created, which is the final format Explorer needs, and the pixel data is copied into it.

A panic must not take Explorer down with it

The last step of the pipeline is the one that makes the extension safe to ship. The entire thumbnail generation process is wrapped in a panic handler, catch_unwind, and the reason given is that if any unexpected error occurs during rendering it will not crash the host application, and the example given is explorer.exe. This is the correct instinct for a shell extension. The DLL is loaded into a process the user is looking at, and a fault in a third party thumbnail provider takes down every folder the user opens afterwards until they restart the machine. The same reasoning explains the earlier note about the staging bitmap, which is declared to Direct2D as having premultiplied alpha format because that is required for proper bitmap operations, while the actual pixel values contain straight alpha data because of the unpremultiply effect, and the README points out that Direct2D normally only works with premultiplied alpha but that this does not matter here because the data is only being copied out to GDI. It is a precise and narrow exception, and it is documented.

Some SVGs will render as black squares, and that is a platform limit

The current limitations section is short and worth reading before you install. Currently, a small fraction of SVGs may render as black squares or as being filled completely black. The reason is that such SVGs contain properties not supported by the Direct2D API, which the extension uses, and there is also no support for text glyphs. The README's assessment is that a vast majority of SVGs should render correctly, and it invites an issue if you notice files from a particular program that consistently do not render. That is a reasonable trade to accept, because the alternative to a black square is usually an extra runtime and an extra dependency inside Explorer, but it does mean the extension is not a general purpose SVG renderer. It is an SVG thumbnail provider, and anything that depends on a feature Direct2D has not implemented will look wrong rather than fail loudly.

The Rust build is tuned for the binary, and the workspace holds test harnesses

The Cargo manifest shows how the release is configured, and the comments are as informative as the values. The release profile keeps debug symbols, sets opt-level to 3 to maximise optimisation for speed, enables fat link time optimisation with a note that it matters for auto-vectorising loops, sets codegen-units to 1 for slower compile times but significantly faster and smaller binaries, and leaves strip false. The package builds as both a cdylib and a lib, which is what lets it be loaded as a Windows DLL and tested as a Rust library. The dependencies are the windows crate at 0.61 with a long list of feature flags covering Direct2D, DXGI, Direct3D, GDI, MSXML, COM, the shell properties system, the registry and security, plus windows-core and windows-registry. The workspace also carries Testing, Testing/unload-harness and Testing/gauntlet, which is a good sign for an extension that runs inside another process, since it means the crash and unload behaviour is exercised rather than assumed. The releases are v1.10.0 on 2026-04-23, v1.11.0 on 2026-07-27 and v1.11.1 on 2026-07-28, and the last push was on 2026-07-28.

Editorial conclusion

Adopt win-svg-thumbs-rust if you work with SVG assets on Windows and want Explorer to preview them without installing a full graphics toolchain, because the extension uses only the Windows API and ships as a signed installer. Do not adopt it if your artwork relies on features Direct2D does not implement, since the README states that some SVGs render as black squares and that text glyphs are not supported. Before you install, disable any other SVG thumbnail provider such as the one from PowerToys, and if you register the DLL by hand, remember it has to live in a directory that requires administrator write access.

Frequently asked questions

What does win-svg-thumbs-rust do?

It is a thumbnail provider for Windows that generates Explorer thumbnails for .svg and .svgz files. It is written in Rust, renders purely through the Windows API using Direct2D, has no third party dependencies beyond the official Microsoft windows-rs crates, and is signed via Azure Trusted Signing.

How do I install the SVG thumbnail extension?

Run winget install ThioJoe.SvgThumbnailExtension in a command prompt, or download the .msi installer from the releases page and run it. After installing, the README asks you to disable any other SVG thumbnail extensions that may interfere, such as the one from PowerToys.

How do I register the DLL manually?

Download the latest win_svg_thumbs.dll, place it somewhere that requires admin access to write such as a folder in C:\Program Files, open a Command Prompt with administrator privileges, and run regsvr32 win_svg_thumbs.dll. Without administrator rights you get the error 0x80004005 for lack of permission, and uninstalling is regsvr32 /u win_svg_thumbs.dll.

Why do some SVG files render as black squares?

The README states that a small fraction of SVGs may render as black squares or as filled completely black, because they contain properties not supported by the Direct2D API that the extension uses, and there is also no support for text glyphs. A vast majority should render correctly, and the author asks for an issue if files from a particular program consistently fail.

How does the extension avoid crashing Windows Explorer?

The entire thumbnail generation process is wrapped in a panic handler using catch_unwind, so that an unexpected error during rendering does not crash the host application such as explorer.exe.

Official sources

  1. Issues
  2. License: MIT
  3. README
  4. Releases
  5. ThioJoe/win-svg-thumbs-rust on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/thiojoe-win-svg-thumbs-rust.svg)](https://hysenlabs.com/projects/thiojoe-win-svg-thumbs-rust)

Was this useful?