I'm using the WebImage in MVC3 in order to resize an image. Basically, the purpose of this is to create a thumbnail image of a file that is uploaded. I will have no control over how large the files are originally, so I need to create a thumbnail of the file in order to speed up the "preview" site.
I have some files which need to be uploaded and in size, its around 4Mb which isn't a problem when it comes to uploading. The problem I'm having is creating the thumbnail. I upload the file first and once its saved on the server, I then create a new WebImage object for the thumbnail.
// Save a thumbnail of the file
WebImage image = new WebImage(savedFileName);
// Resize the image
image.Resize(135, 150, true);
// Save the thumbnail
image.Save(FileName); // <<--- Out of memory exception here
// Dispose of the image
image = null;
When I try to save the file, I get an Out-of-memory exception. Any ideas on how I can resolve this?