mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-18 06:22:58 +00:00
Add Pixso (.pip, .pix) support to ThumbnailViewer
This commit is contained in:
@@ -60,6 +60,20 @@ internal static class Handler
|
||||
context.PreferredSize = new Size { Width = 100, Height = 100 };
|
||||
}
|
||||
}
|
||||
else if (path.EndsWith(".pip", StringComparison.OrdinalIgnoreCase) || path.EndsWith(".pix", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
try
|
||||
{
|
||||
using Stream imageData = ViewImage(path);
|
||||
BitmapImage bitmap = imageData.ReadAsBitmapImage();
|
||||
context.SetPreferredSizeFit(new Size(bitmap.PixelWidth, bitmap.PixelHeight), 0.8d);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_ = e;
|
||||
context.PreferredSize = new Size { Width = 100, Height = 100 };
|
||||
}
|
||||
}
|
||||
else if (path.EndsWith(".xmind", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
try
|
||||
@@ -155,6 +169,32 @@ internal static class Handler
|
||||
StreamResourceInfo info = Application.GetResourceStream(new Uri("pack://application:,,,/QuickLook.Plugin.ThumbnailViewer;component/Resources/broken.png"));
|
||||
return info?.Stream;
|
||||
}
|
||||
else if (path.EndsWith(".pip", StringComparison.OrdinalIgnoreCase) || path.EndsWith(".pix", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
try
|
||||
{
|
||||
using ZipArchive archive = ZipArchive.Open(path, new());
|
||||
using IReader reader = archive.ExtractAllEntries();
|
||||
|
||||
while (reader.MoveToNextEntry())
|
||||
{
|
||||
if (reader.Entry.Key!.EndsWith(".thumb.png", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MemoryStream ms = new();
|
||||
using EntryStream stream = reader.OpenEntryStream();
|
||||
stream.CopyTo(ms);
|
||||
return ms;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
///
|
||||
}
|
||||
|
||||
StreamResourceInfo info = Application.GetResourceStream(new Uri("pack://application:,,,/QuickLook.Plugin.ThumbnailViewer;component/Resources/broken.png"));
|
||||
return info?.Stream;
|
||||
}
|
||||
else if (path.EndsWith(".xmind", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
using ZipArchive archive = ZipArchive.Open(path, new());
|
||||
|
@@ -33,6 +33,7 @@ public class Plugin : IViewer
|
||||
".cdr", // CorelDraw
|
||||
".fig", // Figma
|
||||
".kra", // Krita
|
||||
".pip", ".pix", // Pixso
|
||||
".xd", // AdobeXD
|
||||
".xmind", // XMind
|
||||
]);
|
||||
|
Reference in New Issue
Block a user