diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs index 620c573..8c390f5 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs @@ -18,7 +18,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Windows; using QuickLook.Common.Helpers; using QuickLook.Common.Plugin; @@ -28,18 +27,20 @@ namespace QuickLook.Plugin.ImageViewer { public class Plugin : IViewer { - private static readonly string[] Formats = - { - // camera raw - ".ari", ".arw", ".bay", ".crw", ".cr2", ".cap", ".dcs", ".dcr", ".dng", ".drf", ".eip", ".erf", ".fff", - ".iiq", ".k25", ".kdc", ".mdc", ".mef", ".mos", ".mrw", ".nef", ".nrw", ".obm", ".orf", ".pef", ".ptx", - ".pxn", ".r3d", ".raf", ".raw", ".rwl", ".rw2", ".rwz", ".sr2", ".srf", ".srw", ".x3f", - // normal - ".bmp", ".hdr", ".heic", ".heif", ".ico", ".icon", ".jpg", ".jpeg", ".psd", ".wdp", ".tif", ".tiff", ".tga", - ".webp", ".pbm", ".pgm", ".ppm", ".pnm", ".svg", ".emf", ".wmf", - // animated - ".png", ".apng", ".gif" - }; + private static readonly HashSet Formats = new HashSet( + new[] + { + // camera raw + ".ari", ".arw", ".bay", ".crw", ".cr2", ".cap", ".dcs", ".dcr", ".dng", ".drf", ".eip", ".erf", ".exr", + ".fff", ".iiq", ".k25", ".kdc", ".mdc", ".mef", ".mos", ".mrw", ".nef", ".nrw", ".obm", ".orf", ".pef", + ".ptx", ".pxn", ".r3d", ".raf", ".raw", ".rwl", ".rw2", ".rwz", ".sr2", ".srf", ".srw", ".x3f", + // normal + ".bmp", ".hdr", ".heic", ".heif", ".ico", ".icon", ".jpg", ".jpeg", ".psd", ".wdp", ".tif", ".tiff", + ".tga", ".webp", ".pbm", ".pgm", ".ppm", ".pnm", ".svg", ".emf", ".wmf", + // animated + ".png", ".apng", ".gif" + }); + private ImagePanel _ip; private MetaProvider _meta; @@ -63,7 +64,7 @@ namespace QuickLook.Plugin.ImageViewer public bool CanHandle(string path) { - return !Directory.Exists(path) && Formats.Any(path.ToLower().EndsWith); + return !Directory.Exists(path) && Formats.Contains(Path.GetExtension(path.ToLower())); } public void Prepare(string path, ContextObject context)