I've got a bunch of images stored on disk, with the mimetype of the image stored in a database. If I want to save the image to disk I can use Image.Save(string)
(or the Async version) without needing to know the MimeType of the image.
However, if I want to save to a stream (for example, Response.Body
) then I have to use Image.Save(Stream, IImageEncoder)
.
How do I get the IImageEncoder
I need to save to the stream (without just declaring that "All my images ar png/jpeg/bmp" and using e.g. JpegEncoder
)?