When user uploads file,
What is the best way to check if the image width / height is over a set limit, and resize the image if needed?
Currently I am experimenting with saving the HttpPostedFileBase
to a temp folder in order to load it using Bitmap.FromFile()
just ti check the width/height of the image.
Then, use ImageResizer
library to resize the image using ImageResizer.ImageJob
.
So far I am hitting out of memory exception
at the Bitmap.FromFile(path)
stage.