简体   繁体   English

使用SixLabors ImageSharp检测图像格式

[英]Detect picture format with SixLabors ImageSharp

How do I get the image format using SixLabors.ImageSharp? 如何使用SixLabors.ImageSharp获取图像格式?

In version 1.0.0-alpha9-00152 I could use: 在版本1.0.0-alpha9-00152中,我可以使用:

Image<Rgba32> image = Image.Load(GetBytesFromBlobStorage());
IImageFormat format = image.CurrentImageFormat;

but .CurrentImageFormat() doesn't seen to be able in beta version 1.0.0-beta0001 . .CurrentImageFormat()在测试版1.0.0-beta0001中看不到

I want to know if the image is .png , .bmp or .jpeg . 我想知道图像是.png.bmp还是.jpeg

Yeah, we moved your cheese a little bit with 1.0.0-beta0001 . 是的,我们用1.0.0-beta0001稍微移动了你的奶酪。

The signature you are looking for is now. 您正在寻找的签名现在。

public static Image<TPixel> Load<TPixel>(Stream stream, out IImageFormat format)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM