Image Resizing and caching for ASP.Net core middleware. For more detail visit http://wanderlustcoder.com/blog/2017/07/19/image-resizing-and-disk-caching-in-aspnet-core
In my example http://localhost:57734/images/Test1~small.jpg
will return Test1.jpg in the small size
Makes sure that you have images available for this, the startup will try and copy Test1 to Test5 from a resource directory 4 paths up from the current image dir if they do not exist ..\..\..\..\EO4Codong.Imaging.Resources\Images\
(you can also download this repository)
new Size() {Name="original",MaxX=0,MaxY=0}, //use 0 not to change the original size, this is also registered under the original size and will return the image as is
new Size() {Name="original-cached",MaxX=0,MaxY=0}, //this return the original size, but it wil go through the resizing process which in most cases result in a smaller file size for the same image size, the compression algorithm used seem to compress more/beter, use the test cases to compare size. Test1.jpg in my example reduced from 14MB to 2.5MB using the same size
new Size() {Name="xlarge",MaxX=1900,MaxY=1200 },
new Size() {Name="large",MaxX=1024,MaxY=768 },
new Size() {Name="medium",MaxX=800,MaxY=600 },
new Size() {Name="small",MaxX=300,MaxY=240 },
new Size() {Name="thumbnail",MaxX=160,MaxY=160 }