优化代码

croire 3 years ago
parent 0c559a9bf0
commit ebfba6a59f

@ -59,7 +59,7 @@ namespace DownKyi.Core.Storage
byte[] bytes = File.ReadAllBytes(cover); byte[] bytes = File.ReadAllBytes(cover);
Imazen.WebP.Extern.LoadLibrary.LoadWebPOrFail(); Imazen.WebP.Extern.LoadLibrary.LoadWebPOrFail();
SimpleDecoder simpleDecoder = new SimpleDecoder(); SimpleDecoder simpleDecoder = new SimpleDecoder();
Bitmap bitmap = simpleDecoder.DecodeFromBytes(bytes, bytes.Length); Bitmap bitmap = simpleDecoder.DecodeFromBytes(bytes, bytes.LongLength);
Image thumbnail = bitmap.GetThumbnailImage(width, height, null, IntPtr.Zero); Image thumbnail = bitmap.GetThumbnailImage(width, height, null, IntPtr.Zero);

@ -59,7 +59,7 @@ namespace DownKyi.Core.Storage
byte[] bytes = File.ReadAllBytes(header); byte[] bytes = File.ReadAllBytes(header);
Imazen.WebP.Extern.LoadLibrary.LoadWebPOrFail(); Imazen.WebP.Extern.LoadLibrary.LoadWebPOrFail();
SimpleDecoder simpleDecoder = new SimpleDecoder(); SimpleDecoder simpleDecoder = new SimpleDecoder();
Bitmap bitmap = simpleDecoder.DecodeFromBytes(bytes, bytes.Length); Bitmap bitmap = simpleDecoder.DecodeFromBytes(bytes, bytes.LongLength);
Image thumbnail = bitmap.GetThumbnailImage(width, height, null, IntPtr.Zero); Image thumbnail = bitmap.GetThumbnailImage(width, height, null, IntPtr.Zero);

Loading…
Cancel
Save