Detect picture format with SixLabors ImageSharp

妖精的绣舞 提交于 2019-12-07 06:30:20

问题


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

In version 1.0.0-alpha9-00152 I could use:

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.

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


回答1:


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)


来源:https://stackoverflow.com/questions/46807283/detect-picture-format-with-sixlabors-imagesharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!