Imagesharp: "No image formats have been configured" exception throw.

Created on 15 Feb 2017  路  2Comments  路  Source: SixLabors/ImageSharp

I use the code below:

byte[] image = HttpHelper.HttpGetImage("http://xxxx/xxx.jpg", "");
Image obj = new Image(image);
var width = obj.Width;
var height = obj.Height;

but the exception will throw out while new an Image instance by using the byte[].
What' the problem? How to fix it?

Most helpful comment

@ZhiqiangTao

  • Make sure you are using the newest official MyGet packages
  • Image formats live in separate packages. Make sure you are referencing ImageSharp.Formats.Jpeg
  • When posting an issue, do not remove the issue template, it's here for a reason

All 2 comments

@ZhiqiangTao

  • Make sure you are using the newest official MyGet packages
  • Image formats live in separate packages. Make sure you are referencing ImageSharp.Formats.Jpeg
  • When posting an issue, do not remove the issue template, it's here for a reason

you need to reference one or more of the ImageSharp.Formats.XXX pacakges.

Was this page helpful?
0 / 5 - 0 ratings