mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-30 18:15:41 +00:00
20 lines
667 B
C#
20 lines
667 B
C#
using ImageMagick;
|
|
|
|
namespace Spacebar.AdminApi.TestClient.Services;
|
|
|
|
public static class Mimes {
|
|
private static string PrintLogged(string msg, string mime) {
|
|
Console.WriteLine($"{msg}: {mime}");
|
|
return mime;
|
|
}
|
|
|
|
public static string GetMime(MagickFormat fmt) => fmt switch {
|
|
MagickFormat.Png => "image/png",
|
|
MagickFormat.Jpeg => "image/jpeg",
|
|
MagickFormat.Gif => "image/gif",
|
|
MagickFormat.Bmp => "image/bmp",
|
|
MagickFormat.Tiff => "image/tiff",
|
|
MagickFormat.WebP => "image/webp",
|
|
_ => PrintLogged("Unknown mime for format " + fmt.ToString() + "!", "application/octet-stream")
|
|
};
|
|
} |