mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-31 21:08:27 +01:00
Add support for converting from svg to other image types
This commit is contained in:
@@ -28,6 +28,11 @@ namespace MediaBrowser.Model.Drawing
|
||||
/// <summary>
|
||||
/// The webp.
|
||||
/// </summary>
|
||||
Webp
|
||||
Webp,
|
||||
|
||||
/// <summary>
|
||||
/// The svg format.
|
||||
/// </summary>
|
||||
Svg,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ public static class ImageFormatExtensions
|
||||
ImageFormat.Jpg => MediaTypeNames.Image.Jpeg,
|
||||
ImageFormat.Png => "image/png",
|
||||
ImageFormat.Webp => "image/webp",
|
||||
ImageFormat.Svg => "image/svg+xml",
|
||||
_ => throw new InvalidEnumArgumentException(nameof(format), (int)format, typeof(ImageFormat))
|
||||
};
|
||||
|
||||
@@ -39,6 +40,7 @@ public static class ImageFormatExtensions
|
||||
ImageFormat.Jpg => ".jpg",
|
||||
ImageFormat.Png => ".png",
|
||||
ImageFormat.Webp => ".webp",
|
||||
ImageFormat.Svg => ".svg",
|
||||
_ => throw new InvalidEnumArgumentException(nameof(format), (int)format, typeof(ImageFormat))
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user