mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-12 10:19:07 +00:00
Fix exception from SVG WebView2
This commit is contained in:
@@ -80,15 +80,12 @@ public class MetaProvider
|
|||||||
return new Size(w, h);
|
return new Size(w, h);
|
||||||
|
|
||||||
// fallback
|
// fallback
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var mi = new MagickImage())
|
using var mi = new MagickImage();
|
||||||
{
|
mi.Ping(_path);
|
||||||
mi.Ping(_path);
|
w = (int)mi.Width;
|
||||||
w = (int)mi.Width;
|
h = (int)mi.Height;
|
||||||
h = (int)mi.Height;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
@@ -44,12 +44,12 @@ public class SvgImagePanel : WebpagePanel
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
_objectForScripting = value;
|
_objectForScripting = value;
|
||||||
|
_webView?.EnsureCoreWebView2Async()
|
||||||
Dispatcher.Invoke(async () =>
|
.ContinueWith(_ =>
|
||||||
{
|
_webView?.Dispatcher.Invoke(() =>
|
||||||
await _webView.EnsureCoreWebView2Async();
|
_webView?.CoreWebView2.AddHostObjectToScript("external", value)
|
||||||
_webView.CoreWebView2.AddHostObjectToScript("external", value);
|
)
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user