Skip to content

Commit c685de0

Browse files
committed
follow updates
1 parent 165248b commit c685de0

File tree

36 files changed

+345
-278
lines changed

36 files changed

+345
-278
lines changed

QuickLook.Common/Helpers/TranslationHelper.cs

+7-3
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ public class TranslationHelper
3333

3434
[MethodImpl(MethodImplOptions.NoInlining)]
3535
public static string Get(string id, string file = null, CultureInfo locale = null, string failsafe = null,
36-
Assembly calling = null)
36+
string domain = "QuickLook")
3737
{
3838
if (file == null)
39-
file = Path.Combine(Path.GetDirectoryName((calling ?? Assembly.GetCallingAssembly()).Location),
40-
"Translations.config");
39+
{
40+
var subDir = domain == "QuickLook" ? "" : $"QuickLook.Plugin\\{domain}";
41+
file = Path.Combine(
42+
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), // path of QuickLook.Common.dll
43+
subDir, "Translations.config");
44+
}
4145

4246
if (!File.Exists(file))
4347
return failsafe ?? id;

QuickLook.Common/app.config

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<runtime>
44
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
55
<dependentAssembly>
6-
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
7-
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
6+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
7+
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
88
</dependentAssembly>
99
<dependentAssembly>
10-
<assemblyIdentity name="Microsoft.Extensions.DependencyModel" publicKeyToken="adb9793829ddae60" culture="neutral" />
11-
<bindingRedirect oldVersion="0.0.0.0-3.1.6.0" newVersion="3.1.6.0" />
10+
<assemblyIdentity name="Microsoft.Extensions.DependencyModel" publicKeyToken="adb9793829ddae60" culture="neutral"/>
11+
<bindingRedirect oldVersion="0.0.0.0-3.1.6.0" newVersion="3.1.6.0"/>
1212
</dependentAssembly>
1313
<dependentAssembly>
14-
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
15-
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
14+
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
15+
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
1616
</dependentAssembly>
1717
</assemblyBinding>
1818
</runtime>
19-
</configuration>
19+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>

QuickLook.Native/QuickLook.Native64/QuickLook.Native64.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<VCProjectVersion>15.0</VCProjectVersion>
3535
<ProjectGuid>{794E4DCF-F715-4836-9D30-ABD296586D23}</ProjectGuid>
3636
<RootNamespace>QuickLookNative64</RootNamespace>
37-
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
37+
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
3838
<ProjectName>QuickLook.Native64</ProjectName>
3939
</PropertyGroup>
4040
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

QuickLook.Plugin/QuickLook.Plugin.CsvViewer/QuickLook.Plugin.CsvViewer.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<FileAlignment>512</FileAlignment>
1313
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1414
<WarningLevel>4</WarningLevel>
15+
<TargetFrameworkProfile />
1516
</PropertyGroup>
1617
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1718
<DebugSymbols>true</DebugSymbols>
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<runtime>
44
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
55
<dependentAssembly>
6-
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
7-
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
6+
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
7+
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
88
</dependentAssembly>
99
<dependentAssembly>
10-
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
11-
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
10+
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
11+
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0"/>
1212
</dependentAssembly>
1313
<dependentAssembly>
14-
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
15-
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
14+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
15+
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
1616
</dependentAssembly>
1717
<dependentAssembly>
18-
<assemblyIdentity name="Microsoft.Extensions.DependencyModel" publicKeyToken="adb9793829ddae60" culture="neutral" />
19-
<bindingRedirect oldVersion="0.0.0.0-3.1.6.0" newVersion="3.1.6.0" />
18+
<assemblyIdentity name="Microsoft.Extensions.DependencyModel" publicKeyToken="adb9793829ddae60" culture="neutral"/>
19+
<bindingRedirect oldVersion="0.0.0.0-3.1.6.0" newVersion="3.1.6.0"/>
2020
</dependentAssembly>
2121
<dependentAssembly>
22-
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
23-
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
22+
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
23+
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
2424
</dependentAssembly>
2525
</assemblyBinding>
2626
</runtime>
27-
</configuration>
27+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<runtime>
44
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
55
<dependentAssembly>
6-
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
7-
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
6+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
7+
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
88
</dependentAssembly>
99
<dependentAssembly>
10-
<assemblyIdentity name="Microsoft.Extensions.DependencyModel" publicKeyToken="adb9793829ddae60" culture="neutral" />
11-
<bindingRedirect oldVersion="0.0.0.0-3.1.6.0" newVersion="3.1.6.0" />
10+
<assemblyIdentity name="Microsoft.Extensions.DependencyModel" publicKeyToken="adb9793829ddae60" culture="neutral"/>
11+
<bindingRedirect oldVersion="0.0.0.0-3.1.6.0" newVersion="3.1.6.0"/>
1212
</dependentAssembly>
1313
<dependentAssembly>
14-
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
15-
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
14+
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
15+
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
1616
</dependentAssembly>
1717
</assemblyBinding>
1818
</runtime>
19-
</configuration>
19+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<runtime>
44
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
55
<dependentAssembly>
6-
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
7-
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
6+
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
7+
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
88
</dependentAssembly>
99
<dependentAssembly>
10-
<assemblyIdentity name="System.Diagnostics.Tracing" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
11-
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
10+
<assemblyIdentity name="System.Diagnostics.Tracing" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
11+
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0"/>
1212
</dependentAssembly>
1313
<dependentAssembly>
14-
<assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
15-
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
14+
<assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
15+
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
1616
</dependentAssembly>
1717
<dependentAssembly>
18-
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
19-
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
18+
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
19+
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
2020
</dependentAssembly>
2121
<dependentAssembly>
22-
<assemblyIdentity name="System.Runtime.Extensions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
23-
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
22+
<assemblyIdentity name="System.Runtime.Extensions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
23+
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
2424
</dependentAssembly>
2525
<dependentAssembly>
26-
<assemblyIdentity name="System.Runtime.InteropServices" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
27-
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
26+
<assemblyIdentity name="System.Runtime.InteropServices" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
27+
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
2828
</dependentAssembly>
2929
<dependentAssembly>
30-
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
31-
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
30+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
31+
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
3232
</dependentAssembly>
3333
<dependentAssembly>
34-
<assemblyIdentity name="Microsoft.Extensions.DependencyModel" publicKeyToken="adb9793829ddae60" culture="neutral" />
35-
<bindingRedirect oldVersion="0.0.0.0-3.1.6.0" newVersion="3.1.6.0" />
34+
<assemblyIdentity name="Microsoft.Extensions.DependencyModel" publicKeyToken="adb9793829ddae60" culture="neutral"/>
35+
<bindingRedirect oldVersion="0.0.0.0-3.1.6.0" newVersion="3.1.6.0"/>
3636
</dependentAssembly>
3737
<dependentAssembly>
38-
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
39-
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
38+
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
39+
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
4040
</dependentAssembly>
4141
</assemblyBinding>
4242
</runtime>
43-
</configuration>
43+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>

QuickLook.Plugin/QuickLook.Plugin.HtmlViewer/WebpagePanel.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using System.Diagnostics;
2020
using System.IO;
2121
using System.Windows;
22+
using System.Reflection;
2223
using System.Windows.Controls;
2324
using Microsoft.Web.WebView2.Core;
2425
using Microsoft.Web.WebView2.Wpf;
@@ -92,7 +93,8 @@ private object CreateDownloadButton()
9293
{
9394
var button = new Button
9495
{
95-
Content = TranslationHelper.Get("WEBVIEW2_NOT_AVAILABLE"),
96+
Content = Content = TranslationHelper.Get("WEBVIEW2_NOT_AVAILABLE",
97+
domain: Assembly.GetExecutingAssembly().GetName().Name),
9698
HorizontalAlignment = HorizontalAlignment.Center,
9799
VerticalAlignment = VerticalAlignment.Center,
98100
Padding = new Thickness(20, 6, 20, 6)
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<runtime>
44
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
55
<dependentAssembly>
6-
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
7-
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
6+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
7+
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
88
</dependentAssembly>
99
<dependentAssembly>
10-
<assemblyIdentity name="Microsoft.Extensions.DependencyModel" publicKeyToken="adb9793829ddae60" culture="neutral" />
11-
<bindingRedirect oldVersion="0.0.0.0-3.1.6.0" newVersion="3.1.6.0" />
10+
<assemblyIdentity name="Microsoft.Extensions.DependencyModel" publicKeyToken="adb9793829ddae60" culture="neutral"/>
11+
<bindingRedirect oldVersion="0.0.0.0-3.1.6.0" newVersion="3.1.6.0"/>
1212
</dependentAssembly>
1313
<dependentAssembly>
14-
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
15-
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
14+
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
15+
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
1616
</dependentAssembly>
1717
</assemblyBinding>
1818
</runtime>
19-
</configuration>
19+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>

QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs

+42-11
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using System.Collections.Generic;
2020
using System.IO;
2121
using System.Windows;
22+
using ImageMagick;
2223
using QuickLook.Common.Helpers;
2324
using QuickLook.Common.Plugin;
2425
using QuickLook.Plugin.ImageViewer.AnimatedImage.Providers;
@@ -27,17 +28,28 @@ namespace QuickLook.Plugin.ImageViewer
2728
{
2829
public class Plugin : IViewer
2930
{
30-
private static readonly HashSet<string> Formats = new HashSet<string>(new[]
31+
private static readonly HashSet<string> WellKnownImageExtensions = new HashSet<string>(new[]
3132
{
32-
// camera raw ,add dds - add by gh
33-
".apng", ".ari", ".arw", ".avif", ".bay", ".crw", ".cr2", ".cr3", ".cap", ".dcs", ".dcr", ".dng", ".drf", ".eip", ".erf", ".exr",".fff",
34-
".iiq", ".k25", ".kdc", ".mdc", ".mef", ".mos", ".mrw", ".nef", ".nrw", ".obm", ".orf", ".pef", ".ptx",
35-
".pxn", ".r3d", ".raf", ".raw", ".rwl", ".rw2", ".rwz", ".sr2", ".srf", ".srw", ".x3f", ".dds",
36-
// normal
37-
".bmp", ".hdr", ".heic", ".heif", ".ico", ".icon", ".jpg", ".jpeg", ".jfif", ".psd", ".wdp", ".tif", ".tiff", ".tga",
38-
".webp", ".pbm", ".pgm", ".ppm", ".pnm", ".svg", ".emf", ".wmf",
39-
// animated
40-
".png", ".apng", ".gif"
33+
".apng", ".ari", ".arw", ".avif",
34+
".svg", ".tga", ".tif", ".tiff", ".webp", ".wmf", ".bay", ".bmp",
35+
".cap", ".cr2", ".cr3", ".crw",
36+
".dcr", ".dcs", ".dng", ".drf",
37+
".eip", ".emf", ".erf", ".exr",
38+
".fff",
39+
".gif",
40+
".hdr", ".heic", ".heif",
41+
".ico", ".icon", ".iiq",
42+
".jfif", ".jp2", ".jpeg", ".jpg", ".jxl",
43+
".k25", ".kdc",
44+
".mdc", ".mef", ".mos", ".mrw",
45+
".nef", ".nrw",
46+
".obm", ".orf",
47+
".pbm", ".pef", ".pgm", ".png", ".pnm", ".ppm", ".psd", ".ptx", ".pxn",
48+
".r3d", ".raf", ".raw", ".rw2", ".rwl", ".rwz",
49+
".sr2", ".srf", ".srw", ".svg",
50+
".tga", ".tif", ".tiff",
51+
".wdp", ".webp", ".wmf",
52+
".x3f"
4153
});
4254
private ImagePanel _ip;
4355
private MetaProvider _meta;
@@ -59,10 +71,29 @@ public void Init()
5971
new KeyValuePair<string[], Type>(new[] {"*"},
6072
typeof(ImageMagickProvider)));
6173
}
74+
private bool IsWellKnownImageExtension(string path)
75+
{
76+
return WellKnownImageExtensions.Contains(Path.GetExtension(path.ToLower()));
77+
}
78+
79+
private bool IsImageMagickSupported(string path)
80+
{
81+
try
82+
{
83+
return new MagickImageInfo(path).Format != MagickFormat.Unknown;
84+
}
85+
catch
86+
{
87+
return false;
88+
}
89+
}
6290

6391
public bool CanHandle(string path)
6492
{
65-
return !Directory.Exists(path) && Formats.Contains(Path.GetExtension(path.ToLower()));
93+
// Disabled due mishandling text file types e.g., "*.config".
94+
// Only check extension for well known image and animated image types.
95+
// For other image formats, let ImageMagick try to detect by file content.
96+
return !Directory.Exists(path) && (IsWellKnownImageExtension(path)); // || IsImageMagickSupported(path));
6697
}
6798

6899
public void Prepare(string path, ContextObject context)

0 commit comments

Comments
 (0)