Add DICOM image support to ImageViewer plugin #1866

This is not a permanent support and will be adjusted to the plugin later.
This commit is contained in:
ema
2026-02-03 00:36:28 +08:00
parent 4c16a3dd72
commit 866613402a
6 changed files with 356 additions and 2 deletions
@@ -26,7 +26,7 @@ using System.Xml;
namespace QuickLook.Plugin.ImageViewer;
public class MetaProvider
public partial class MetaProvider
{
private readonly SortedDictionary<string, (string, string)> _cache = []; // [key, [label, value]]
@@ -79,6 +79,13 @@ public class MetaProvider
if (int.TryParse(w_.Item2, out var w) && int.TryParse(h_.Item2, out var h))
return new Size(w, h);
if (IsDicomFile(_path))
{
var dicomSize = TryGetDicomSize(_path);
if (!dicomSize.IsEmpty)
return dicomSize;
}
// fallback
try
{