Below is the action method that returns images from the database as they are, I need some lite library or write the code myself if short that will resize and compress these images according to my requirements "Make thumbnails" before they are passed to the HTTP response.
EDIT: Actually come to think of it, perhaps it would be best to save thumbnails in additional column, so now I need a way to compress and resize the images before they are saved to the database a long with saving a copy that is untouched. Saving images initially by passing them in HttpPostedFileBase and now need some tool that will resize and compress before saving to database.
public FileContentResult GetImage(int LineID)
{
var PMedia = repository.ProductMedias.FirstOrDefault(x => x.LineID == LineID);
if (PMedia != null)
{
return File(PMedia.ImageData, PMedia.ImageMimeType, PMedia.FileName);
}
else
{
return null;
}
}