diff options
| author | hawken <hawken@thehawken.org> | 2019-01-12 12:45:14 +0000 |
|---|---|---|
| committer | hawken <hawken@thehawken.org> | 2019-01-13 11:59:24 +0000 |
| commit | f2dae8ee519904116cd11381eee518ce55db4373 (patch) | |
| tree | c6647d1d4bad74386f87d335fa2709bed1428878 | |
| parent | 78a5d999f4e5c92dfc70d4428f88a3c6597dea9d (diff) | |
Make image header extension matching case insensitive
| -rw-r--r-- | Emby.Drawing/Common/ImageHeader.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Emby.Drawing/Common/ImageHeader.cs b/Emby.Drawing/Common/ImageHeader.cs index f37f396f5..844c966bb 100644 --- a/Emby.Drawing/Common/ImageHeader.cs +++ b/Emby.Drawing/Common/ImageHeader.cs @@ -50,12 +50,13 @@ namespace Emby.Drawing.Common /// <exception cref="ArgumentException">The image was of an unrecognised format.</exception> public static ImageSize GetDimensions(string path, ILogger logger, IFileSystem fileSystem) { - var extension = Path.GetExtension(path); - - if (string.IsNullOrEmpty(extension)) + if (string.IsNullOrEmpty(path)) { - throw new ArgumentException("ImageHeader doesn't support image file"); + throw new ArgumentNullException(nameof(path)); } + + string extension = Path.GetExtension(path).ToLower(); + if (!SupportedExtensions.Contains(extension)) { throw new ArgumentException("ImageHeader doesn't support " + extension); |
