Hello,
We need the ability to gracefully resize any photo/image to an exact width/height without skewing the image. We can use either a third-party solution, or we can use the built-in .NET functionality to handle this. I thought there had to be an easy solution to this without having to program a complex algorithm.
Example Scenario (We want all uploads to be resized to 200x100 pixels)
Landscape photo with dimensions at 1250x800:
Resizing the width to 200px would proportionately put the height at 128px so that extra 28px would be cropped off of the top and bottom.
Landscape photo with dimensions at 1250x500:
Resizing the width to 200px proportionately put the heigth at 80px so we would need to catch that and resize by height first. Putting the height at 100px would proportionately put the width at 250px. The extra 50px would need to be cropped off of the sides of the photo.
Portrait photo with dimensions at 800x950:
Resizing the width to 200px would proportionately put the height at 238px so that extra 138px would be cropped off of the top and bottom.