mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[FileExplorer-Add-ons][SVG] Preprocess svg thumbnail before previewing (#18685)
* [FileExplorer-Add-ons][SVG Thumbnail] Preprocess svg thumbnail before previewing same logic is usedas for preview handler * Fix build
This commit is contained in:
@@ -12,7 +12,6 @@ using System.Windows.Forms;
|
|||||||
using Common;
|
using Common;
|
||||||
using Common.Utilities;
|
using Common.Utilities;
|
||||||
using Microsoft.PowerToys.PreviewHandler.Svg.Telemetry.Events;
|
using Microsoft.PowerToys.PreviewHandler.Svg.Telemetry.Events;
|
||||||
using Microsoft.PowerToys.PreviewHandler.Svg.Utilities;
|
|
||||||
using Microsoft.PowerToys.Telemetry;
|
using Microsoft.PowerToys.Telemetry;
|
||||||
using Microsoft.Web.WebView2.Core;
|
using Microsoft.Web.WebView2.Core;
|
||||||
using Microsoft.Web.WebView2.WinForms;
|
using Microsoft.Web.WebView2.WinForms;
|
||||||
|
|||||||
@@ -252,6 +252,13 @@ namespace Microsoft.PowerToys.ThumbnailHandler.Svg
|
|||||||
using (var reader = new StreamReader(stream))
|
using (var reader = new StreamReader(stream))
|
||||||
{
|
{
|
||||||
svgData = reader.ReadToEnd();
|
svgData = reader.ReadToEnd();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
svgData = SvgPreviewHandlerHelper.AddStyleSVG(svgData);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// See the LICENSE file in the project root for more information.
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Microsoft.PowerToys.PreviewHandler.Svg.Utilities;
|
using Common.Utilities;
|
||||||
using Microsoft.PowerToys.STATestExtension;
|
using Microsoft.PowerToys.STATestExtension;
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,10 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
|
||||||
namespace Microsoft.PowerToys.PreviewHandler.Svg.Utilities
|
namespace Common.Utilities
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper utilities for Svg Preview Handler.
|
/// Helper utilities for Svg Preview Handler.
|
||||||
Reference in New Issue
Block a user