Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which package do I need for Images in asp.net 5?

Previously it was System.Drawing namespace for images. I am not sure which library do I need in asp.net 5 to have an object of Image type.

like image 767
eadam Avatar asked Feb 10 '15 09:02

eadam


People also ask

Where do you put Blazor images?

Place the images in a new folder named images in the app's web root ( wwwroot ). The use of the images folder is only for demonstration purposes. You can organize images in any folder layout that you prefer, including serving the images directly from the wwwroot folder.


1 Answers

There's a bunch of libraries that can fill the gap, afaik there is no drop in replacement for System.Drawing.

I've hit the same problem and I'm looking at these libs:

  • http://imageresizing.net
  • http://imageprocessor.org/

Update

Looks these libs are not quite ready to work without System.Drawing yet. There are reports that you can still reference System.Drawing if an older .Net version is installed on the server. Add the following bits to your project.json:

"frameworks": {
    "aspnet50": {
         "dependencies": {
             "System.Drawing": ""
        }
    }
} 

More info on this topic here: https://github.com/imazen/Graphics-vNext . The gist of that discussion is that there is no real alternative yet.

Update 2

Scott Hanselman has blogged about this. Seems that server side image processing is not a priority at all for Microsoft at this point.

So for now the best bet is still on the projects mentioned above.

like image 52
Marnix van Valen Avatar answered Oct 25 '22 07:10

Marnix van Valen