|
|
|
@ -17,12 +17,12 @@ public static class ImageFormatExtensions
|
|
|
|
|
public static string GetMimeType(this ImageFormat format)
|
|
|
|
|
=> format switch
|
|
|
|
|
{
|
|
|
|
|
ImageFormat.Bmp => "image/bmp",
|
|
|
|
|
ImageFormat.Bmp => MediaTypeNames.Image.Bmp,
|
|
|
|
|
ImageFormat.Gif => MediaTypeNames.Image.Gif,
|
|
|
|
|
ImageFormat.Jpg => MediaTypeNames.Image.Jpeg,
|
|
|
|
|
ImageFormat.Png => "image/png",
|
|
|
|
|
ImageFormat.Webp => "image/webp",
|
|
|
|
|
ImageFormat.Svg => "image/svg+xml",
|
|
|
|
|
ImageFormat.Png => MediaTypeNames.Image.Png,
|
|
|
|
|
ImageFormat.Webp => MediaTypeNames.Image.Webp,
|
|
|
|
|
ImageFormat.Svg => MediaTypeNames.Image.Svg,
|
|
|
|
|
_ => throw new InvalidEnumArgumentException(nameof(format), (int)format, typeof(ImageFormat))
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|