diff --git a/Brotli.Core/Brotli.Core.csproj b/Brotli.Core/Brotli.Core.csproj index e88d1ed..aafe0ea 100644 --- a/Brotli.Core/Brotli.Core.csproj +++ b/Brotli.Core/Brotli.Core.csproj @@ -17,6 +17,7 @@ The library use the native runtime and its performance should be better than Sys For more document,please visit https://github.com/XieJJ99/brotli.net. MIT 2.1.1.0 + AnyCPU;x64;x86 diff --git a/DatabaseManager/DatabaseManager.csproj b/DatabaseManager/DatabaseManager.csproj index da46220..343a04e 100644 --- a/DatabaseManager/DatabaseManager.csproj +++ b/DatabaseManager/DatabaseManager.csproj @@ -35,6 +35,22 @@ prompt 4 + + x64 + bin\x64\Debug\ + + + x64 + bin\x64\Release\ + + + x86 + bin\x86\Debug\ + + + x86 + bin\x86\Release\ + diff --git a/DownKyi.Core.Test/DownKyi.Core.Test.csproj b/DownKyi.Core.Test/DownKyi.Core.Test.csproj index 85a7801..9a7c6c4 100644 --- a/DownKyi.Core.Test/DownKyi.Core.Test.csproj +++ b/DownKyi.Core.Test/DownKyi.Core.Test.csproj @@ -38,6 +38,22 @@ prompt 4 + + x64 + bin\x64\Debug\ + + + x64 + bin\x64\Release\ + + + x86 + bin\x86\Debug\ + + + x86 + bin\x86\Release\ + ..\packages\MSTest.TestFramework.2.2.8\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll diff --git a/DownKyi.Core/DownKyi.Core.csproj b/DownKyi.Core/DownKyi.Core.csproj index b1c17ae..76d1fe3 100644 --- a/DownKyi.Core/DownKyi.Core.csproj +++ b/DownKyi.Core/DownKyi.Core.csproj @@ -32,6 +32,22 @@ prompt 4 + + x64 + bin\x64\Debug\ + + + x64 + bin\x64\Release\ + + + x86 + bin\x86\Debug\ + + + x86 + bin\x86\Release\ + ..\packages\Brotli.NET.2.1.1\lib\net45\Brotli.Core.dll @@ -39,6 +55,9 @@ ..\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 diff --git a/DownKyi.Core/Properties/AssemblyInfo.cs b/DownKyi.Core/Properties/AssemblyInfo.cs index 18b88bb..e1eb9c3 100644 --- a/DownKyi.Core/Properties/AssemblyInfo.cs +++ b/DownKyi.Core/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("DownKyi")] [assembly: AssemblyProduct("DownKyi.Core")] -[assembly: AssemblyCopyright("Copyright © Downkyi 2020-2021")] +[assembly: AssemblyCopyright("Copyright © Downkyi 2020-2022")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/DownKyi.Core/Storage/StorageCover.cs b/DownKyi.Core/Storage/StorageCover.cs index 13aa340..dc4e69b 100644 --- a/DownKyi.Core/Storage/StorageCover.cs +++ b/DownKyi.Core/Storage/StorageCover.cs @@ -1,6 +1,7 @@ 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; @@ -51,15 +52,26 @@ namespace DownKyi.Core.Storage return StorageUtils.BitmapToBitmapImage(new Bitmap(thumbnail)); } - catch (ArgumentException e) + catch (ArgumentException) { - Utils.Debugging.Console.PrintLine(cover); - Utils.Debugging.Console.PrintLine("GetCoverThumbnail()发生异常: {0}", e); + try + { + byte[] bytes = File.ReadAllBytes(cover); + Imazen.WebP.Extern.LoadLibrary.LoadWebPOrFail(); + SimpleDecoder simpleDecoder = new SimpleDecoder(); + Bitmap bitmap = simpleDecoder.DecodeFromBytes(bytes, bytes.Length); - LogManager.Error("StorageCover.GetCoverThumbnail()", cover); - LogManager.Error("StorageCover.GetCoverThumbnail()", e); + Image thumbnail = bitmap.GetThumbnailImage(width, height, null, IntPtr.Zero); - return null; + return StorageUtils.BitmapToBitmapImage(new Bitmap(thumbnail)); + } + catch (Exception ex) + { + Utils.Debugging.Console.PrintLine("GetCoverThumbnail()发生异常: {0}", ex); + LogManager.Error("StorageCover.GetCoverThumbnail()", ex); + + return null; + } } catch (Exception e) { diff --git a/DownKyi.Core/Storage/StorageHeader.cs b/DownKyi.Core/Storage/StorageHeader.cs index 5a89e99..b988269 100644 --- a/DownKyi.Core/Storage/StorageHeader.cs +++ b/DownKyi.Core/Storage/StorageHeader.cs @@ -1,6 +1,7 @@ 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; @@ -51,15 +52,26 @@ namespace DownKyi.Core.Storage return StorageUtils.BitmapToBitmapImage(new Bitmap(thumbnail)); } - catch (ArgumentException e) + catch (ArgumentException) { - Utils.Debugging.Console.PrintLine(header); - Utils.Debugging.Console.PrintLine("GetHeaderThumbnail()发生异常: {0}", e); + try + { + byte[] bytes = File.ReadAllBytes(header); + Imazen.WebP.Extern.LoadLibrary.LoadWebPOrFail(); + SimpleDecoder simpleDecoder = new SimpleDecoder(); + Bitmap bitmap = simpleDecoder.DecodeFromBytes(bytes, bytes.Length); - LogManager.Error("StorageHeader.GetHeaderThumbnail()", header); - LogManager.Error("StorageHeader.GetHeaderThumbnail()", e); + Image thumbnail = bitmap.GetThumbnailImage(width, height, null, IntPtr.Zero); - return null; + return StorageUtils.BitmapToBitmapImage(new Bitmap(thumbnail)); + } + catch (Exception ex) + { + Utils.Debugging.Console.PrintLine("GetHeaderThumbnail()发生异常: {0}", ex); + LogManager.Error("StorageHeader.GetHeaderThumbnail()", ex); + + return null; + } } catch (Exception e) { diff --git a/DownKyi.Core/packages.config b/DownKyi.Core/packages.config index c49a756..5ee2b66 100644 --- a/DownKyi.Core/packages.config +++ b/DownKyi.Core/packages.config @@ -3,6 +3,7 @@ + diff --git a/DownKyi.sln b/DownKyi.sln index 5bc5e70..30ddbe1 100644 --- a/DownKyi.sln +++ b/DownKyi.sln @@ -19,29 +19,73 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Debug|x64.ActiveCfg = Debug|x64 + {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Debug|x64.Build.0 = Debug|x64 + {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Debug|x86.ActiveCfg = Debug|x86 + {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Debug|x86.Build.0 = Debug|x86 {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Release|Any CPU.ActiveCfg = Release|Any CPU {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Release|Any CPU.Build.0 = Release|Any CPU + {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Release|x64.ActiveCfg = Release|x64 + {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Release|x64.Build.0 = Release|x64 + {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Release|x86.ActiveCfg = Release|x86 + {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Release|x86.Build.0 = Release|x86 {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Debug|x64.ActiveCfg = Debug|x64 + {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Debug|x64.Build.0 = Debug|x64 + {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Debug|x86.ActiveCfg = Debug|x86 + {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Debug|x86.Build.0 = Debug|x86 {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Release|Any CPU.ActiveCfg = Release|Any CPU {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Release|Any CPU.Build.0 = Release|Any CPU + {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Release|x64.ActiveCfg = Release|x64 + {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Release|x64.Build.0 = Release|x64 + {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Release|x86.ActiveCfg = Release|x86 + {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Release|x86.Build.0 = Release|x86 {3107CD63-E257-455E-AE81-1FD3582B067A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3107CD63-E257-455E-AE81-1FD3582B067A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3107CD63-E257-455E-AE81-1FD3582B067A}.Debug|x64.ActiveCfg = Debug|x64 + {3107CD63-E257-455E-AE81-1FD3582B067A}.Debug|x64.Build.0 = Debug|x64 + {3107CD63-E257-455E-AE81-1FD3582B067A}.Debug|x86.ActiveCfg = Debug|x86 + {3107CD63-E257-455E-AE81-1FD3582B067A}.Debug|x86.Build.0 = Debug|x86 {3107CD63-E257-455E-AE81-1FD3582B067A}.Release|Any CPU.ActiveCfg = Release|Any CPU {3107CD63-E257-455E-AE81-1FD3582B067A}.Release|Any CPU.Build.0 = Release|Any CPU + {3107CD63-E257-455E-AE81-1FD3582B067A}.Release|x64.ActiveCfg = Release|x64 + {3107CD63-E257-455E-AE81-1FD3582B067A}.Release|x64.Build.0 = Release|x64 + {3107CD63-E257-455E-AE81-1FD3582B067A}.Release|x86.ActiveCfg = Release|x86 + {3107CD63-E257-455E-AE81-1FD3582B067A}.Release|x86.Build.0 = Release|x86 {81B9719E-DA29-444F-BB72-CBD5819A654D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {81B9719E-DA29-444F-BB72-CBD5819A654D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {81B9719E-DA29-444F-BB72-CBD5819A654D}.Debug|x64.ActiveCfg = Debug|x64 + {81B9719E-DA29-444F-BB72-CBD5819A654D}.Debug|x64.Build.0 = Debug|x64 + {81B9719E-DA29-444F-BB72-CBD5819A654D}.Debug|x86.ActiveCfg = Debug|x86 + {81B9719E-DA29-444F-BB72-CBD5819A654D}.Debug|x86.Build.0 = Debug|x86 {81B9719E-DA29-444F-BB72-CBD5819A654D}.Release|Any CPU.ActiveCfg = Release|Any CPU {81B9719E-DA29-444F-BB72-CBD5819A654D}.Release|Any CPU.Build.0 = Release|Any CPU + {81B9719E-DA29-444F-BB72-CBD5819A654D}.Release|x64.ActiveCfg = Release|x64 + {81B9719E-DA29-444F-BB72-CBD5819A654D}.Release|x64.Build.0 = Release|x64 + {81B9719E-DA29-444F-BB72-CBD5819A654D}.Release|x86.ActiveCfg = Release|x86 + {81B9719E-DA29-444F-BB72-CBD5819A654D}.Release|x86.Build.0 = Release|x86 {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Debug|Any CPU.Build.0 = Debug|Any CPU + {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Debug|x64.ActiveCfg = Debug|x64 + {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Debug|x64.Build.0 = Debug|x64 + {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Debug|x86.ActiveCfg = Debug|x86 + {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Debug|x86.Build.0 = Debug|x86 {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Release|Any CPU.ActiveCfg = Release|Any CPU {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Release|Any CPU.Build.0 = Release|Any CPU + {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Release|x64.ActiveCfg = Release|x64 + {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Release|x64.Build.0 = Release|x64 + {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Release|x86.ActiveCfg = Release|x86 + {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DownKyi/.gitignore b/DownKyi/.gitignore new file mode 100644 index 0000000..cf47342 --- /dev/null +++ b/DownKyi/.gitignore @@ -0,0 +1,2 @@ +!x64 +!x86 \ No newline at end of file diff --git a/DownKyi/DownKyi.csproj b/DownKyi/DownKyi.csproj index 64479af..cc4e6b2 100644 --- a/DownKyi/DownKyi.csproj +++ b/DownKyi/DownKyi.csproj @@ -56,6 +56,22 @@ app.manifest + + x64 + bin\x64\Debug\ + + + x64 + bin\x64\Release\ + + + x86 + bin\x86\Debug\ + + + x86 + bin\x86\Release\ + @@ -481,6 +497,7 @@ ResXFileCodeGenerator Resources.Designer.cs + @@ -562,6 +579,12 @@ + + PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/DownKyi/Properties/AssemblyInfo.cs b/DownKyi/Properties/AssemblyInfo.cs index 557ec1b..d25d8bb 100644 --- a/DownKyi/Properties/AssemblyInfo.cs +++ b/DownKyi/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ using System.Windows; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("DownKyi")] [assembly: AssemblyProduct("DownKyi")] -[assembly: AssemblyCopyright("Copyright © Downkyi 2020-2021")] +[assembly: AssemblyCopyright("Copyright © Downkyi 2020-2022")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/DownKyi/x64/libwebp.dll b/DownKyi/x64/libwebp.dll new file mode 100644 index 0000000..fe717fd Binary files /dev/null and b/DownKyi/x64/libwebp.dll differ diff --git a/DownKyi/x86/libwebp.dll b/DownKyi/x86/libwebp.dll new file mode 100644 index 0000000..1b5e5c6 Binary files /dev/null and b/DownKyi/x86/libwebp.dll differ