Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
server-side responsive images
public FilePathResult Image(int id, int x, int y)
var image = db.Images.First(i => i.ID == id);
var newPath = image.GetFile(imagePath, new Size(x, y));
return File(newPath, "image/jpeg");
public string GetFile(string imageDirectory, Size size)
=> ImageRetriever.GetImage(imageDirectory, Name, size)
?? ImageCreator.CreateImage(imageDirectory, Name, size);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.