aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Drawing')
-rw-r--r--Emby.Drawing/Common/ImageHeader.cs11
-rw-r--r--Emby.Drawing/ImageProcessor.cs22
-rw-r--r--Emby.Drawing/Properties/AssemblyInfo.cs18
3 files changed, 26 insertions, 25 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>
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs
index 6a67be56d..4e4b36507 100644
--- a/Emby.Drawing/ImageProcessor.cs
+++ b/Emby.Drawing/ImageProcessor.cs
@@ -80,7 +80,7 @@ namespace Emby.Drawing
{
if (value == null)
{
- throw new ArgumentNullException("value");
+ throw new ArgumentNullException(nameof(value));
}
_imageEncoder = value;
@@ -103,7 +103,7 @@ namespace Emby.Drawing
"crw",
// Remove until supported
- //"nef",
+ //"nef",
"orf",
"pef",
"arw",
@@ -179,7 +179,7 @@ namespace Emby.Drawing
{
if (options == null)
{
- throw new ArgumentNullException("options");
+ throw new ArgumentNullException(nameof(options));
}
var originalImage = options.Image;
@@ -491,7 +491,7 @@ namespace Emby.Drawing
{
if (string.IsNullOrEmpty(path))
{
- throw new ArgumentNullException("path");
+ throw new ArgumentNullException(nameof(path));
}
try
@@ -691,12 +691,12 @@ namespace Emby.Drawing
{
if (string.IsNullOrEmpty(originalImagePath))
{
- throw new ArgumentNullException("originalImagePath");
+ throw new ArgumentNullException(nameof(originalImagePath));
}
if (item == null)
{
- throw new ArgumentNullException("item");
+ throw new ArgumentNullException(nameof(item));
}
var treatmentRequiresTransparency = false;
@@ -779,16 +779,16 @@ namespace Emby.Drawing
{
if (string.IsNullOrEmpty(path))
{
- throw new ArgumentNullException("path");
+ throw new ArgumentNullException(nameof(path));
}
if (string.IsNullOrEmpty(uniqueName))
{
- throw new ArgumentNullException("uniqueName");
+ throw new ArgumentNullException(nameof(uniqueName));
}
if (string.IsNullOrEmpty(fileExtension))
{
- throw new ArgumentNullException("fileExtension");
+ throw new ArgumentNullException(nameof(fileExtension));
}
var filename = uniqueName.GetMD5() + fileExtension;
@@ -811,11 +811,11 @@ namespace Emby.Drawing
{
if (string.IsNullOrEmpty(path))
{
- throw new ArgumentNullException("path");
+ throw new ArgumentNullException(nameof(path));
}
if (string.IsNullOrEmpty(filename))
{
- throw new ArgumentNullException("filename");
+ throw new ArgumentNullException(nameof(filename));
}
var prefix = filename.Substring(0, 1);
diff --git a/Emby.Drawing/Properties/AssemblyInfo.cs b/Emby.Drawing/Properties/AssemblyInfo.cs
index b9e9c2ff7..8dfefe0af 100644
--- a/Emby.Drawing/Properties/AssemblyInfo.cs
+++ b/Emby.Drawing/Properties/AssemblyInfo.cs
@@ -1,20 +1,20 @@
-using System.Reflection;
+using System.Reflection;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Emby.Drawing")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Emby.Drawing")]
-[assembly: AssemblyCopyright("Copyright © 2015")]
+[assembly: AssemblyCompany("Jellyfin Project")]
+[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@@ -24,7 +24,7 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
-// \ No newline at end of file
+//