Jellyfin.Drawing minor improvements

Reduce duplicate/dead code
This commit is contained in:
Bond_009
2023-10-05 23:57:11 +02:00
parent d5e86188a1
commit c707baed83
8 changed files with 37 additions and 93 deletions

View File

@@ -204,16 +204,10 @@ namespace MediaBrowser.Providers.MediaInfo
? Path.GetExtension(attachmentStream.FileName)
: MimeTypes.ToExtension(attachmentStream.MimeType);
if (string.IsNullOrEmpty(extension))
{
extension = ".jpg";
}
ImageFormat format = extension switch
{
".bmp" => ImageFormat.Bmp,
".gif" => ImageFormat.Gif,
".jpg" => ImageFormat.Jpg,
".png" => ImageFormat.Png,
".webp" => ImageFormat.Webp,
_ => ImageFormat.Jpg