diff --git a/DownKyi.Core/DownKyi.Core.csproj b/DownKyi.Core/DownKyi.Core.csproj index 615b25e..fe62e68 100644 --- a/DownKyi.Core/DownKyi.Core.csproj +++ b/DownKyi.Core/DownKyi.Core.csproj @@ -55,9 +55,6 @@ ..\packages\Google.Protobuf.3.19.1\lib\net45\Google.Protobuf.dll - - ..\packages\Imazen.WebP.10.0.1\lib\net45\Imazen.WebP.dll - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll @@ -97,6 +94,9 @@ + + ..\packages\WebP.Net.0.5.0\lib\net472\WebP.Net.dll + @@ -363,7 +363,9 @@ + + \ No newline at end of file diff --git a/DownKyi.Core/Storage/StorageCover.cs b/DownKyi.Core/Storage/StorageCover.cs index 892491d..f16343b 100644 --- a/DownKyi.Core/Storage/StorageCover.cs +++ b/DownKyi.Core/Storage/StorageCover.cs @@ -1,11 +1,11 @@ using DownKyi.Core.Logging; using DownKyi.Core.Storage.Database; using DownKyi.Core.Utils.Encryptor; -using Imazen.WebP; using System; using System.Drawing; using System.IO; using System.Windows.Media.Imaging; +using WebP.Net; namespace DownKyi.Core.Storage { @@ -56,11 +56,8 @@ namespace DownKyi.Core.Storage { try { - byte[] bytes = File.ReadAllBytes(cover); - Imazen.WebP.Extern.LoadLibrary.LoadWebPOrFail(); - SimpleDecoder simpleDecoder = new SimpleDecoder(); - Bitmap bitmap = simpleDecoder.DecodeFromBytes(bytes, bytes.LongLength); - + SimpleDecoder simpleDecoder = new SimpleDecoder(cover); + Bitmap bitmap = simpleDecoder.WebPtoBitmap(); Image thumbnail = bitmap.GetThumbnailImage(width, height, null, IntPtr.Zero); return StorageUtils.BitmapToBitmapImage(new Bitmap(thumbnail)); diff --git a/DownKyi.Core/Storage/StorageHeader.cs b/DownKyi.Core/Storage/StorageHeader.cs index bc7ec4c..ab959aa 100644 --- a/DownKyi.Core/Storage/StorageHeader.cs +++ b/DownKyi.Core/Storage/StorageHeader.cs @@ -1,11 +1,11 @@ using DownKyi.Core.Logging; using DownKyi.Core.Storage.Database; using DownKyi.Core.Utils.Encryptor; -using Imazen.WebP; using System; using System.Drawing; using System.IO; using System.Windows.Media.Imaging; +using WebP.Net; namespace DownKyi.Core.Storage { @@ -56,11 +56,8 @@ namespace DownKyi.Core.Storage { try { - byte[] bytes = File.ReadAllBytes(header); - Imazen.WebP.Extern.LoadLibrary.LoadWebPOrFail(); - SimpleDecoder simpleDecoder = new SimpleDecoder(); - Bitmap bitmap = simpleDecoder.DecodeFromBytes(bytes, bytes.LongLength); - + SimpleDecoder simpleDecoder = new SimpleDecoder(header); + Bitmap bitmap = simpleDecoder.WebPtoBitmap(); Image thumbnail = bitmap.GetThumbnailImage(width, height, null, IntPtr.Zero); return StorageUtils.BitmapToBitmapImage(new Bitmap(thumbnail)); diff --git a/DownKyi.Core/packages.config b/DownKyi.Core/packages.config index 5ee2b66..8fe23c3 100644 --- a/DownKyi.Core/packages.config +++ b/DownKyi.Core/packages.config @@ -3,7 +3,6 @@ - @@ -12,4 +11,5 @@ + \ No newline at end of file