Add UseNativeProvider option #1726

Use following option in `QuickLook.Plugin.ImageViewer.config` to fix the issue:
```xml
<?xml version="1.0" encoding="utf-8"?>
<Settings>
  <UseColorProfile>false</UseColorProfile>
  <UseNativeProvider>false</UseNativeProvider>
</Settings>
```
This commit is contained in:
ema
2025-08-02 01:36:13 +08:00
parent efe47ff43b
commit 67b5dbf310
3 changed files with 29 additions and 17 deletions

View File

@@ -65,8 +65,16 @@ public class Plugin : IViewer
public void Init()
{
// Option of UseColorProfile:
// Default is False (disable color profile conversion)
// Note that enabling this feature will slow down image previewing, especially on large images.
var useColorProfile = SettingHelper.Get("UseColorProfile", false, "QuickLook.Plugin.ImageViewer");
// Option of UseNativeProvider:
// Default is True (disable precise colors and choose faster response)
// Note that disabling this feature may slightly slow down image previewing but you can get precise colors.
var useNativeProvider = SettingHelper.Get("UseNativeProvider", true, "QuickLook.Plugin.ImageViewer");
AnimatedImage.AnimatedImage.Providers.Add(
new KeyValuePair<string[], Type>(
useColorProfile ? [".apng"] : [".apng", ".png"],
@@ -76,7 +84,7 @@ public class Plugin : IViewer
typeof(GifProvider)));
AnimatedImage.AnimatedImage.Providers.Add(
new KeyValuePair<string[], Type>(
useColorProfile ? [] : [".bmp", ".jpg", ".jpeg", ".jfif", ".tif", ".tiff"],
useColorProfile ? [] : (useNativeProvider ? [".bmp", ".jpg", ".jpeg", ".jfif", ".tif", ".tiff"] : []),
typeof(NativeProvider)));
AnimatedImage.AnimatedImage.Providers.Add(
new KeyValuePair<string[], Type>([".jxr"],