Add EXR to ImageViewer

This commit is contained in:
Paddy Xu
2020-08-16 12:13:39 +02:00
parent 7fc6e03ffa
commit 41b42d81e9

View File

@@ -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<string> Formats = new HashSet<string>(
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)