Skip to content

Instantly share code, notes, and snippets.

@doxavore
Created September 29, 2010 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doxavore/603217 to your computer and use it in GitHub Desktop.
Save doxavore/603217 to your computer and use it in GitHub Desktop.
// Load the original image from disk
using (Image originalImage = Image.FromFile(Server.MapPath("~/App_Data/" + file.FileName)))
{
// Apply the queued transformations to the original image
using (Image newImage = filters.Apply(originalImage))
{
return File(newImage.ToByteArray(), file.ContentType);
}
}
@MarkBorcherding
Copy link

What about

using (Image originalImage = Image.FromFile(Server.MapPath("~/App_Data/" + file.FileName)))
using (Image newImage = filters.Apply(originalImage))  {
                return File(newImage.ToByteArray(), file.ContentType);
}

if you just don't like the indentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment