Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/jellyfin/blame/commit/e4cb6519127692231d04e5ce6d9060c2e7ace3a3/MediaBrowser.Model/Drawing/ImageFormatExtensions.cs You should set ROOT_URL correctly, otherwise the web may not work correctly.
jellyfin/MediaBrowser.Model/Drawing/ImageFormatExtensions.cs

47 lines
1.9 KiB

using System.ComponentModel;
using System.Net.Mime;
namespace MediaBrowser.Model.Drawing;
/// <summary>
/// Extension class for the <see cref="ImageFormat" /> enum.
/// </summary>
public static class ImageFormatExtensions
{
/// <summary>
/// Returns the correct mime type for this <see cref="ImageFormat" />.
/// </summary>
/// <param name="format">This <see cref="ImageFormat" />.</param>
/// <exception cref="InvalidEnumArgumentException">The <paramref name="format"/> is an invalid enumeration value.</exception>
/// <returns>The correct mime type for this <see cref="ImageFormat" />.</returns>
public static string GetMimeType(this ImageFormat format)
=> format switch
{
ImageFormat.Bmp => "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",
_ => throw new InvalidEnumArgumentException(nameof(format), (int)format, typeof(ImageFormat))
};
/// <summary>
/// Returns the correct extension for this <see cref="ImageFormat" />.
/// </summary>
/// <param name="format">This <see cref="ImageFormat" />.</param>
/// <exception cref="InvalidEnumArgumentException">The <paramref name="format"/> is an invalid enumeration value.</exception>
/// <returns>The correct extension for this <see cref="ImageFormat" />.</returns>
public static string GetExtension(this ImageFormat format)
=> format switch
{
ImageFormat.Bmp => ".bmp",
ImageFormat.Gif => ".gif",
ImageFormat.Jpg => ".jpg",
ImageFormat.Png => ".png",
ImageFormat.Webp => ".webp",
ImageFormat.Svg => ".svg",
_ => throw new InvalidEnumArgumentException(nameof(format), (int)format, typeof(ImageFormat))
};
}