使用SixLabors ImageSharp检测图片格式 [英] Detect picture format with SixLabors ImageSharp

查看:1137
本文介绍了使用SixLabors ImageSharp检测图片格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用SixLabors.ImageSharp获取图像格式?

How do I get the image format using SixLabors.ImageSharp?

在版本 1.0.0-alpha9-00152 中,我可以使用:

In version 1.0.0-alpha9-00152 I could use:

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

,但.CurrentImageFormat()在beta版本 1.0.0-beta0001 中似乎不能够.

but .CurrentImageFormat() doesn't seen to be able in beta version 1.0.0-beta0001.

我想知道图像是 .png .bmp 还是 .jpeg .

I want to know if the image is .png, .bmp or .jpeg.

推荐答案

是的,我们用 1.0.0-beta0001 将您的奶酪稍微移动了.

Yeah, we moved your cheese a little bit with 1.0.0-beta0001.

现在正在寻找您的签名.

The signature you are looking for is now.

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

这篇关于使用SixLabors ImageSharp检测图片格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆