From b7c6ffe0131db74ba50fb397d43279af8f616bce Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 19 Oct 2016 02:29:00 -0400 Subject: [PATCH] handle x-png --- MediaBrowser.Model/Net/MimeTypes.cs | 1 + MediaBrowser.Providers/Manager/ImageSaver.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs index 8bf0703be..2c059c860 100644 --- a/MediaBrowser.Model/Net/MimeTypes.cs +++ b/MediaBrowser.Model/Net/MimeTypes.cs @@ -100,6 +100,7 @@ namespace MediaBrowser.Model.Net .ToDictionary(x => x.Key, x => x.First().Key, StringComparer.OrdinalIgnoreCase); dict["image/jpg"] = ".jpg"; + dict["image/x-png"] = ".png"; return dict; } diff --git a/MediaBrowser.Providers/Manager/ImageSaver.cs b/MediaBrowser.Providers/Manager/ImageSaver.cs index 7e1fa8984..767c034ee 100644 --- a/MediaBrowser.Providers/Manager/ImageSaver.cs +++ b/MediaBrowser.Providers/Manager/ImageSaver.cs @@ -356,6 +356,11 @@ namespace MediaBrowser.Providers.Manager var season = item as Season; var extension = MimeTypes.ToExtension(mimeType); + if (string.IsNullOrWhiteSpace(extension)) + { + throw new ArgumentException(string.Format("Unable to determine image file extension from mime type {0}", mimeType)); + } + if (type == ImageType.Thumb && saveLocally) { if (season != null && season.IndexNumber.HasValue)