aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing/Common/ImageHeader.cs
diff options
context:
space:
mode:
authorErwin de Haan <EraYaN@users.noreply.github.com>2019-01-17 17:48:01 +0100
committerGitHub <noreply@github.com>2019-01-17 17:48:01 +0100
commite241589969c643116f9fc5c24bcf2009fed83fe5 (patch)
tree5a9e7d266b5f79c6d90a4767e804887b40b87b1c /Emby.Drawing/Common/ImageHeader.cs
parent47f08fbb12db5854f5e474ddbf70b758ca084616 (diff)
parent7aa975325af87fe425fe143aaed1df830133be8b (diff)
Merge branch 'dev' into skia-native-arm
Diffstat (limited to 'Emby.Drawing/Common/ImageHeader.cs')
-rw-r--r--Emby.Drawing/Common/ImageHeader.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/Emby.Drawing/Common/ImageHeader.cs b/Emby.Drawing/Common/ImageHeader.cs
index f37f396f5..3aa0cac25 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);
@@ -94,7 +95,7 @@ namespace Emby.Drawing.Common
}
}
- throw new ArgumentException(ErrorMessage, "binaryReader");
+ throw new ArgumentException(ErrorMessage, nameof(binaryReader));
}
/// <summary>