1 2 3 4 5 6 7 8 9 10 11 12 |
public string GetMimeType(Image image) { var ImageCodec = ImageCodecInfo.GetImageDecoders(); foreach (var item in ImageCodec) { if (item.FormatID == image.RawFormat.Guid) { return item.MimeType; } } return "image/unknown"; } |