Imagesharp Resize Image Keep Aspect Ratio. In my last post i showed a way to crop and resize an image downloaded from a url using the imagesharp library this was in response to a post in which dmitry sikorsky used the corecompat system drawing library to achieve the same thing. That that simply will not do for this project.
We also need to update the copy in resizeextensions resize methods. I say the thumbnail can be at most 320x320. So here s the secret.
The purpose of that post was simply to compare the two libraries from an api perspective and to demonstrate imagesharp in the application.
Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio. Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio. I ve been using imagesharp to do this a new image library that runs on netstandard1 1 and is written entirely in managed code so is fully cross platform. The resulting image should then have the size of 320x240.