[bug report]DetectImage函数存在bug,无法正确获取一些图片的信息
Chronostasys opened this issue · comments
Environment / 环境
Version or commit hash you using.
你所使用的Konata.Core
版本或提交哈希
2f9751f
Operating system information.
操作系统相关信息
macOS Monterey 12.5.1
Expected behavior / 预期行为
A clear and concise description of what you expected to happen.
清晰明了地阐述你所遇到的问题.
上方图片无法正常上传
To Reproduce / 复现
Paste your code snippet below.
在这里粘贴你的代码片段
var c = new HttpClient();
var bs = await c.GetByteArrayAsync("https://cdn.mo2.leezeeyee.com/6" +
"03ba0e2dfacf44803d8c780/1659593390232351509image.png~thumb");
var r = FileFormat.DetectImage(bs, out var type, out var w, out var h);
Assert.AreEqual(type, FileFormat.ImageFormat.Webp);
Assert.AreEqual(w, 304);// 这个不对
Assert.AreEqual(h, 131);// 这个是0
Stack trace / 堆栈信息
Paste the stack trace below.
在这里粘贴堆栈信息
无