From 41c8cbbe8a6342d1a5a8c560ef0a006f1337d86f Mon Sep 17 00:00:00 2001 From: trackd Date: Sat, 23 Nov 2024 00:55:16 +0100 Subject: [PATCH] with working cts atleast.. --- module/Sixel.Types.ps1xml | 14 ------------- module/Sixel.format.ps1xml | 40 +++++++++++++++++++------------------- module/Sixel.psd1 | 2 +- src/Sixel/Protocols/gif.cs | 5 ++--- 4 files changed, 23 insertions(+), 38 deletions(-) delete mode 100644 module/Sixel.Types.ps1xml diff --git a/module/Sixel.Types.ps1xml b/module/Sixel.Types.ps1xml deleted file mode 100644 index 0c6f630..0000000 --- a/module/Sixel.Types.ps1xml +++ /dev/null @@ -1,14 +0,0 @@ - - - Sixel.Terminal.Models.SixelGif - - - ToString - - - - - diff --git a/module/Sixel.format.ps1xml b/module/Sixel.format.ps1xml index 9b45ba0..ccb5c46 100644 --- a/module/Sixel.format.ps1xml +++ b/module/Sixel.format.ps1xml @@ -1,23 +1,23 @@  - - - Sixel.Terminal.Models.SixelGif - - Sixel.Terminal.Models.SixelGif - - - - - - - - $_.ToString() + + + Sixel.Terminal.Models.SixelGif + + Sixel.Terminal.Models.SixelGif + + + + + + + + $_ | Show-SixelGif - - - - - - - + + + + + + + diff --git a/module/Sixel.psd1 b/module/Sixel.psd1 index 702227d..67dac3f 100644 --- a/module/Sixel.psd1 +++ b/module/Sixel.psd1 @@ -14,7 +14,7 @@ CmdletsToExport = @('ConvertTo-Sixel', 'New-SixelGif','Show-SixelGif') AliasesToExport = @('cts', 'ConvertTo-InlineImage') FormatsToProcess = @('Sixel.format.ps1xml') - TypesToProcess = @('Sixel.Types.ps1xml') + TypesToProcess = @() PrivateData = @{ PSData = @{ Tags = @( diff --git a/src/Sixel/Protocols/gif.cs b/src/Sixel/Protocols/gif.cs index 06ddb7a..da373c0 100644 --- a/src/Sixel/Protocols/gif.cs +++ b/src/Sixel/Protocols/gif.cs @@ -11,9 +11,8 @@ namespace Sixel.Protocols; public static class GifToSixel { public static SixelGif LoadGif(Stream imageStream, int maxColors, int cellWidth, int LoopCount) { - var image = Image.Load(imageStream); - var gif = ConvertGifToSixel(image, maxColors, cellWidth, LoopCount); - return gif; + using var image = Image.Load(imageStream); + return ConvertGifToSixel(image, maxColors, cellWidth, LoopCount); } private static SixelGif ConvertGifToSixel(Image image, int maxColors, int cellWidth, int LoopCount) {