From 1ad78c9f4b7fdbed54203c65f6ce8868d0b2dbaa Mon Sep 17 00:00:00 2001 From: Paddy Xu Date: Sun, 27 Jun 2021 11:34:50 +0200 Subject: [PATCH] Disable image detection from file contents (partially revert 3ef980bb1706a7ffa4f67ab7e96e5f3ef74a4d14) --- .../QuickLook.Plugin.ImageViewer/Plugin.cs | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs index 13049d2..444cfc7 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs @@ -30,14 +30,32 @@ namespace QuickLook.Plugin.ImageViewer { private static readonly HashSet WellKnownImageExtensions = new HashSet(new[] { - ".apng", ".bmp", ".gif", ".ico", ".icon", ".jfif", ".jpeg", ".jpg", ".png", ".psd", - ".svg", ".tga", ".tif", ".tiff", ".webp", ".wmf", + ".apng", ".ari", ".arw", ".avif", + ".bay", ".bmp", + ".cap", ".cr2", ".cr3", ".crw", + ".dcr", ".dcs", ".dng", ".drf", + ".eip", ".emf", ".erf", ".exr", + ".fff", + ".gif", + ".hdr", ".heic", ".heif", + ".ico", ".icon", ".iiq", + ".jfif", ".jp2", ".jpeg", ".jpg", ".jxl", + ".k25", ".kdc", + ".mdc", ".mef", ".mos", ".mrw", + ".nef", ".nrw", + ".obm", ".orf", + ".pbm", ".pef", ".pgm", ".png", ".pnm", ".ppm", ".psd", ".ptx", ".pxn", + ".r3d", ".raf", ".raw", ".rw2", ".rwl", ".rwz", + ".sr2", ".srf", ".srw", ".svg", + ".tga", ".tif", ".tiff", + ".wdp", ".webp", ".wmf", + ".x3f" }); private ImagePanel _ip; private MetaProvider _meta; - public int Priority => -4; + public int Priority => 0; public void Init() { @@ -74,9 +92,10 @@ namespace QuickLook.Plugin.ImageViewer public bool CanHandle(string path) { + // Disabled due mishandling text file types e.g., "*.config". // Only check extension for well known image and animated image types. // For other image formats, let ImageMagick try to detect by file content. - return !Directory.Exists(path) && (IsWellKnownImageExtension(path) || IsImageMagickSupported(path)); + return !Directory.Exists(path) && (IsWellKnownImageExtension(path)); // || IsImageMagickSupported(path)); } public void Prepare(string path, ContextObject context)