tibold / svg-explorer-extension Goto Github PK
View Code? Open in Web Editor NEWExtension module for Windows Explorer to render SVG thumbnails, so that you can have an overview of your SVG files
License: Other
Extension module for Windows Explorer to render SVG thumbnails, so that you can have an overview of your SVG files
License: Other
Thank you for this great project !
Can't thank you guys enough.
Just one thing, that would be convenient to add.
I have a lot of SVG files with white lines in it. That's basically, because these SVG files are used on websites with dark backgrounds.
The preview isn't really useful in those cases. But would be if there was a grayish background instead.
For a more universal solution. My proposal is to render SVG images with an additional checkered background. That's also how Google renders previews of images on their image search website. As a bonus, it also makes it instantly visible if there is a white background or a transparent one.
Kind regards
It would be best if we can get the CI build to create it (would also fix #22).
To create the installer the following things would be needed:
Get rid of the install shield scripts and start a new installer based on WiX or Inno or NSIS. Seems to be more work than option 2 but also seems to be better prepared for the future.
Stay using proprietary InstallShield (either someone has a version and can do the steps or we'd be stuck to VS2015 which gives the option to use Install Shield LE)
Any opinions?
Optional for every case: check if someone sponsors a certificate to be used for the binaries and the installer.
I use v1.0.19 x64
1.
<svg width="68" height="48" xmlns="http://www.w3.org/2000/svg"><path d="M66.5 7.7c-.8-2.9-2.5-5.4-5.4-6.2C55.8.1 34 0 34 0S12.2.1 6.9 1.6c-3 .7-4.6 3.2-5.4 6.1a89.6 89.6 0 000 32.5c.8 3 2.5 5.5 5.4 6.3C12.2 47.9 34 48 34 48s21.8-.1 27.1-1.6c3-.7 4.6-3.2 5.4-6.1C68 35 68 24 68 24s0-11-1.5-16.3z"/><path fill="#fff" d="M45 24L27 14v20"/></svg>
Must be
But rendered as
<svg viewBox="0 0 20 22" xmlns="http://www.w3.org/2000/svg"><path d="M12.08 0H7.92A7.92 7.92 0 000 7.91v3.76c0 3.25 2 6.17 5 7.36v2.43a.42.42 0 00.7.31l2.41-2.19h3.97A7.92 7.92 0 0020 11.67V7.9A7.92 7.92 0 0012.08 0z"/><path d="M10.95 6.77a.42.42 0 10-.23.8 1.9 1.9 0 011.3 1.3.42.42 0 00.8-.23 2.72 2.72 0 00-1.87-1.87z" fill="#fff"/><path d="M14.12 9.26c.04 0 .08 0 .12-.02a.4.4 0 00.28-.51A5.3 5.3 0 0010.9 5.1a.42.42 0 10-.23.8 4.45 4.45 0 013.05 3.05c.05.19.22.3.4.3z" fill="#fff"/><path d="M10.72 3.16a.42.42 0 10-.23.8 7.54 7.54 0 015.17 5.17.42.42 0 00.8-.22 8.38 8.38 0 00-5.74-5.75zm4.52 10.22c-.03-.1-.24-.25-.62-.44a18.77 18.77 0 00-.98-.54 17.47 17.47 0 01-.94-.58.54.54 0 00-.23-.06c-.11 0-.25.08-.42.24-.16.16-.31.33-.45.51-.14.19-.28.36-.44.51-.15.16-.28.24-.38.24a.56.56 0 01-.18-.04 1.93 1.93 0 01-.53-.28c-.75-.42-1.4-.9-1.94-1.44A8.68 8.68 0 016.6 9.4a2.98 2.98 0 01-.19-.37.56.56 0 01-.04-.18c0-.1.08-.23.24-.38.15-.16.32-.3.5-.44.2-.14.36-.29.52-.45.16-.17.24-.3.24-.42a.54.54 0 00-.06-.23 19.62 19.62 0 00-1.12-1.91c-.19-.4-.34-.6-.44-.63a.46.46 0 00-.17-.03 3.27 3.27 0 00-1.15.26c-.27.11-.56.45-.87 1a3.2 3.2 0 00-.17 2.84 31.96 31.96 0 00.32.87c.19.54.42 1.02.68 1.44.44.7 1.03 1.44 1.78 2.19s1.48 1.34 2.19 1.78a7.5 7.5 0 001.85.83 32.92 32.92 0 00.85.3 3.6 3.6 0 00.9.12 3.2 3.2 0 001.54-.42c.56-.3.9-.6 1.01-.87a3.25 3.25 0 00.23-1.32z" fill="#fff"/></svg>
Must be:
But rendered as
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M14.3 1c-.7.1-3 .7-3.3 4a5.2 5.2 0 011.8 9.8A5.3 5.3 0 014.7 11c-1-6 4-10.2 9.5-10A10 10 0 000 10a10 10 0 1014.3-9z" fill="#F91600"/></svg>
Must be:
But rendered as
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 0A10 10 0 000 10.4C2.6 6 6 5.3 6.2 5.3V5a2.2 2.2 0 11.5 1.4c-4 2.5-5 8.1-4.9 9.2l1.5 1.8A15 15 0 0113.3 9a2.2 2.2 0 11.5 1.4 11.5 11.5 0 00-6.7 9A10 10 0 0020 10 10 10 0 0010 0z" fill="#FBB616"/></svg>
Must be:
But rendered as
I can provide more examples if need, but I think reason is same for all.
how I can fix render of this svg?
I use SVGOMG for build it.
Would be great, and help facilitate new installs on machines in bulk and smooth updates.
After having this program installed and working with no problems, I uninstalled it for unrelated reasons. When I reinstalled it, though, it doesn't work.
I get this error message every time it tries to render an SVG thumbnail in the background:
---------------------------
DllHost
---------------------------
This application failed to start because no Qt platform plugin could be initialized.
Reinstalling the application may fix this problem.
---------------------------
OK
---------------------------
SVG files do not render.
Deleting the program and reinstalling it does not resolve the issue.
Hi,
I have installed the new Insider image and the extension doesn't work with the new version of Windows.
Bye,
Sandras74
The preview in the image import dialog in PowerPoint only works after the images have been displayed as a preview in Windows Explorer.
The error is reproducible on all our PCs. Only after the preview has been displayed once in Windows Explorer (no matter if large symbols or very large symbols ...) does the preview also work in the Insert image dialog under Office. Otherwise only a symbol image (e for Internet Explorer) is displayed.
We are using Windows 10 (1709) 64Bit and Office 2016 (16.0.9126.2356) 32Bit
'SVG Explorer Extension' is rather long to say and type. What about see-svg or svg-see instead?
The 2nd embeds a nice recursion. ;-)
Hi,
I've just installed this app on my Windows 10 64-bit and I'm having the following issue. My Explorer doesn't autorefresh after creating/deleting a file/folder. I've tried several things. Uninstalling the app and event this https://answers.microsoft.com/en-us/windows/forum/windows_10-files/win-10-64-bit-file-explorer-auto-refresh/703492e6-dffb-4344-9699-7e41b2c4ddee?auth=1 But nothing helped. Is there a way how to remove the app completely and revert any system change it did? Uninstalling it via Windows "Add or remove programs" just wasn't enough. It seems that it still left some of it's folder/files.
Thanks.
Jiri
Scattered throughout there are paths and other references to maphew/svg-explorer-extension
that will need to be converted to tibold/svg-explorer-extension
once #7 is complete. This is a collector issue for those references (e.g. treat opening comment as a wiki)
Readme.md
- installer locations; CI build statusappveyor.yml
- auth token.all-contributorsrc
SVGThumbnailExtension\SVGThumbnailExtension.pro.user
SVGThumbnailExtension\ThumbnailProvider.cpp
Such as: "This is an Explorer extension so there's nothing further to do and no application to run. After installation just navigate in File Explorer to a folder that contains SVGs, and you'll see the contents of those files as their thumbnails, rather than generic icons. If you have the Preview pane open, you'll see a bigger thumbnail there." Needs work on the wording but I hope that gives you the gist of my request. A screenshot would be helpful, perhaps.
Just a little info of this sort, as obvious as it may seem, would be helpful in general for some I think, and would definitely make it clear that when nothing happens after installation something is wrong. That's my situation: I'm pretty sure but not certain, since nothing is said one way or the other, that after you install (the correct version) and then run the little set of system commands, it's supposed to be that nothing further is required: when you browse/Explore you see your SVGs. But since that didn't work for me I'm left wondering: am I missing something, or did the install procedure just not work for me? Am I supposed to manually register the DLL? I will eventually reboot but is that likely to work if the iconcache clearout didn't?
Thank you.
Trend Micro reports the appveyor install .exe's are "potential ransomware".
After pressing [Allow Once] the programs runs as normal (notwithstanding error #36).
Microsoft Windows 10 Enterprise
Version 10.0.18362 Build 18362
Trend Micro 11.000.1006
Simple example:
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="50"
>
<g id="bubble1">
<circle cx="50" cy="50" r="50" />
</g>
</svg>
This should render as half circle (like the browser does), but the thumbnail preview shows the whole drawing, ignoring the width and height attributes of the root <svg>
element.
When the svg file relies on these to clip the image, it is rendered incorrectly.
I think it should render considering those attributes, because the preview should reflect what the image will actually be (e.g. when seeing in a browser).
If the attributes are not present, then it should have the current behavior, considering the whole image.
After installing the x64 version on Windows 10 1809 x64, I only get the following error:
"This application failed to start becuse no Qt platform plugin could be initialized. Reinstallling the application may fix this problem."
I myself develop Software with Qt 5, so my PATH is full of directories containing Qt5 DLLs in various versions. Could that be an issue, that SvgExplorerExtension picks the wrong Qt5Core dll?
The SVG preview does not include line breaks meaning that characters vanish off the side of the preview.
Can someone help me out,,, please ;)
Installed on a Windows 10, x64, latest Insider Build
Now that the build environment appears to be resolved (#18). Next up is to figure out how to test and install the results.
For testing it might be enough to grab the .dll's in https://github.com/maphew/svg-explorer-extension/tree/master/build-SVGThumbnailExtension-Desktop_Qt_5_12_3_MSVC2017_64bit-Debug/debug and replace the same wherever the same exist on a system that has a previous release installed.
I've no idea yet how to create an installer.
This an is incredibly popular project considering it has no maintainer and no developers. I've decided to see if I can learn "just enough" c++ to build what's here (create a binary release). This issue will summarize the successes on the way to that goal, if any.
Warning: it's many GB.
choco install qtcreator
choco install visualstudio2017buildtools
choco install visualstudio2017-workload-vctools
choco install windows-sdk-10.-0
Installation is with Chocolatey wherever I have a choice. The list may be incomplete. I've installed and uninstalled several different programs and versions of programs trying to find the right combination.
2019-09-09 as of commit a02ff34 all compiler errors are gone.
It is good to explicit list the hashes for the installers as it is done now (= ensuring that the binary was not tinkered with or got broken afterwards).
It would be even better to provide pgp signed source snapshots and binaries as this additional ensures that both were actually released by @tibold (as soon/long as his public key is known).
When I try to install on a fresh Windows 10 Pro install, the install fails with the following message:
C:\Program Files\SVG Explorer\Extension\SVGThumbnailExtension.dll
Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x3.
I have narrowed it down to there being no VC runtime installed on the computer. The installer tries to register the DLL before installing the VC runtimes. If I manually install the one packaged with the installer and rerun the install, it works fine. I have also tried with the 2015 VC runtime and it works (and then installs the 2017 VC runtime).
The installer needs to run the VC install before attempting to register the DLL.
I have tried with 1.0.0 and the current dev build. I think you could use the PrepareToInstall function of Innosetup to install it before copying the rest of the files:
https://www.jrsoftware.org/ishelp/index.php?topic=scriptevents
It would be good to know with clarity what version of the extension is actually in use. Spawned from @drewnoakes in #22 (comment).
ThumbnailProvider.cpp:141: error: no member named 'Alpha' in 'QPixmap'; did you mean 'qAlpha'?
...\build-SVGThumbnailExtension-Desktop_Qt_5_12_3_MSVC2017_64bit-Debug\debug\Main.obj:-1: error: LNK1112: module machine type 'x86' conflicts with target machine type 'x64'
Set up CI to run automatic tests on the code and, if all goes well, also build binaries for release and distribution. I'm not set on GitHub Actions vs Travis CI vs {whatever}; just trying what's close at hand first.
The 'test' in subject refers to "does the code compile" testing, not "does the extension actually work" testing in #22.
I treat this first comment as wiki page, updating periodically so pertinent info is always at top.
Appveyor: builds are working - https://ci.appveyor.com/project/maphew/svg-explorer-extension/history - but I don't know what do with them yet, other than verify that new commits don't break the compile
GitHub Actions: not ready for Windows + Qt. Qt must be installed manually and that is not all straightforward.
TravisCI: not tried
Fman Build System: not tried (https://build-system.fman.io/)
Hi
Just installed the 64 version of the SVG explorer extension and it is not working, I still have the IE icon on a svg file.
here is what I have done so far
nothing get the explorer to display any SVG thumbnail
Simple example:
<svg
xmlns="http://www.w3.org/2000/svg"
height="45" width="200">
<text x="0" y="15">
<tspan x="0" y="15">Above</tspan>
<tspan x="0" y="30">Center</tspan>
<tspan x="0" y="45">Below</tspan>
</text>
</svg>
This should render each <tspan>
in a separate line, but the preview is not doing this. It is ignoring either the <tspan>
tag or its x and y attributes.
Oddly enough, unlike #4, the width and height attributes on the root element, are not ignored in this example.
ThumbnailProvider.cpp:141: error: no member named 'toWinHBITMAP' in 'QPixmap'
toWinHBITMAP
doesn't have a clear drop-in replacement, but there is https://stackoverflow.com/a/50236645/14420, "It was moved into the QtWin namespace."
qmake.exe
is not not found. Probably because Qt version has changed and PATHs are hardcoded.
https://ci.appveyor.com/project/maphew/svg-explorer-extension/builds/29292640
Installing the x86-installer on win10-32bit gives the following error-msg:
Internal error: Cannont expand "commonpf64" constant on this version of windows.
I suppose, that changing a x64 variable has been forgotten on the x86-installer....
(Nothing else to say here)
I installed it, and then ran the kill explorer and delete thumbdbs and then restarted explorer and nada.
Currently if there's an invalid SVG icon, the preview will display a transparent image with some text (It's a bit hard to read, but I think it says "Invalid SVG File" in red)
Windows displays invalid images (jpg, png, webp) using the default file icon, and I was thinking using the default svg icon of (whatever viewer they use IE, AI, ImageGlass, ... ) would be more consistent.
Is the current behavior intended?
I imported the svg-explorer-extension from CodePlex posted here to GitHub because I use the extension and I didn't want to lose access to it when CodePlex shut down in 2017.
I'm primarily a python guy and am ill equipped to maintaining this project. So if you know C++ and have some time to spare, please feel free to take over! In the meantime I'm happy to merge pull requests for those who care to offer drive-by fixin's but can't vet them for quality or completeness. ;-)
cheers, Matt
When running the 64 bit installer for maphew appveyor dev release (fake v1.0.30) at the end regsvr32 reports "This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem."
Followed by:
Error
C:\Program Files\Dotz Softwares\SVG Explorer Extension\SVGThumbnailExtension.dll
Unable to register the DLL/OCX: RegSvr32 failed with exit code 0xC0000409.
Click Retry to try again, Ignore to proceed anyway (not recommended), or Abort to cancel installation.
Win10 Enterprise 1803 build 17134.1130
Hi,
Thank you for creating this project!
Unfortunately I need to remove it from one of the machines and I do not find any entry in the add/remove programs. Caan anyone help me with the right way to remove the program?
Many Thanks
The installer did restart my machine without any notification, I did install the lastest version. I'm on Windows 10 Home X64.
I try to compile this extension with an old QT version and it seems some paths are not setup correct (some of the includes use sub-paths, others not).
While I'm still in the process to check if this actually works out or not, these are the current changes needed - are those fine to be done in general or should there be an ifdef guard around this?
-#include <QSvgRenderer>
-#include <QString>
-#include <QDateTime>
+#include <QtSvg/QSvgRenderer> // guess that's fine as we use it in common.h
+#include <QtCore/QString> // other files from QtCore are used in different places
+#include <QtCore/QDateTime>
When this is clear I'll finish my changes and PR them.
No longer is the transparency of the SVG in the preview! The transparency is replaced with a black background which makes any black SVG's fully unviewable in explorer. The SVG needs to display like how a png would in explorer (keep the transparent part of the image transparent)
The way I've set this up, the Appveyor continuous integration system settings are not stored in the source code repo. The docs state that one can use either the web UI or an appveyor.yml
file in the repo. Also some UI settings are just not available in the .yml file. For the present at least we'll stick with the UI approach.
So, I need to document how things have been set up to get to where we are now, so that someone else can do the same without having to spend as much time with trial and error as I have.
This issue is primarily intended as a real question - is there anything else QT is used for than the actual SVG->"preview" part? Can this be done with a more lightweight dependency, too?
I guess the "os-portable" part of QT is completely irrelevant for this "Windows Explorer" plugin, isn't it?
The svg explorer extension is not working inside the onedrive folder, where I synchronise my work to the cloud.
Go into Settings and disable the Save space and download files as you use them option.
With the option enabled files are uploaded to OneDrive and only a "ghost" file is left in its place until you open it, at which point the file is downloaded once again and the extension makes a preview image.
Hat tip to @digitalchet for figuring this out.
Simple example:
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<use
x="120"
y="0"
xlink:href="#shape"
/>
<g id="shape">
<rect x="50" y="50" width="50" height="50" />
<circle cx="50" cy="50" r="50" />
</g>
</svg>
This should render as 2 shapes (like the browser and Inkscape do), but the thumbnail preview only shows 1 shape, not recognizing the <use>
tag.
When the use tag is after the referenced element, both shapes are shown correctly.
I didn't test it, but it is possible that other tags with the href
or xlink:href
attribute also have this incorrect behavior.
If this bug is in an external library (Qt?) then where should the issue be submitted?
0.1.1 = 4.05MB vs. 1.0.0 = 20.4 MB
This report is basically a copy and paste from my superuser forum question here
My Windows version is Windows 10 Home (more specifically, update 1809). My computer is x64 system, so I used that version. After installing the extension, I changed the default app, as suggested here but nothing changed.
I got curious and changed view setting in file explorer and found that when the view is set to Small icons/List/Details, I cannot preview the svg files(icon becomes whatever the default app is), but in other modes, like tiles, I can view the previews. Additionally, I have found that regardless of the view mode, preview in the Details pane(panel at the right edge of the file explorer) works. I have rebooted my pc and restarted explorer through task manager countless times. I also tried to remove the file association for .svg files entirely, hoping that would stop the icons from becoming the default app's. However, The default app just switched to internet explorer and I was not able to fully remove the file association.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.