Open fire-eggs opened 2 years ago
On further investigation, it turns out the SVG files in the epubs from issue #31 are merely containers for base64-encoded bitmap images.
... and the Powertoys implementation uses .NET. So that's a dead-end.
Try third-party extension (need to add .SVG as allowed image inside DarkThumbs)
https://github.com/tibold/svg-explorer-extension/releases powertoys
For V1.7, I've partially addressed this issue. Here's what it looks like:
DarkThumbs V1.7 shows the image from the cover, but isn't able to show the text.
As a reminder to my future self, the technical details are:
<image>
tag, and SVG operations to draw the text over the image.<image>
tag!<image>
tag [assuming they fit a specific pattern] as the thumbnail.For V1.7, I've partially addressed this issue. Here's what it looks like:
DarkThumbs V1.7 shows the image from the cover, but isn't able to show the text.
As a reminder to my future self, the technical details are:
- The "advanced" ebooks from Standard Ebooks use a SVG file for the cover image.
- Windows provides no SVG support in WIC.
- The SVG files consist of two main parts: an embedded, base64-encoded JPEG file in an
<image>
tag, and SVG operations to draw the text over the image.- SVG libraries for C++ which I've investigated should be able to support rendering SVG to create a bitmap ... except they don't support the
<image>
tag!- Thus for V1.7 I've manually unpacked the
<image>
tag [assuming they fit a specific pattern] as the thumbnail.- A future version of Darkthumbs could use a SVG library (lunasvg looks promising) to render the rest of the SVG on top of the current thumbnail.
Thank you for the partial fix! Looking forward to seeing how this lunasvg works!
Fallout from issue #31.
DarkThumbs V1.x uses GDI+ functions to handle images. Those functions don't support SVG files.
Unfortunately, there doesn't seem to be a readily available WIC decoder for SVG files?
powertoys has a thumbnail preview for SVG, source. It also has Preview Pane support.