mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-23 06:00:47 +02:00
Make image header extension matching case insensitive
This commit is contained in:
parent
78a5d999f4
commit
f2dae8ee51
|
@ -50,12 +50,13 @@ namespace Emby.Drawing.Common
|
||||||
/// <exception cref="ArgumentException">The image was of an unrecognised format.</exception>
|
/// <exception cref="ArgumentException">The image was of an unrecognised format.</exception>
|
||||||
public static ImageSize GetDimensions(string path, ILogger logger, IFileSystem fileSystem)
|
public static ImageSize GetDimensions(string path, ILogger logger, IFileSystem fileSystem)
|
||||||
{
|
{
|
||||||
var extension = Path.GetExtension(path);
|
if (string.IsNullOrEmpty(path))
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(extension))
|
|
||||||
{
|
{
|
||||||
throw new ArgumentException("ImageHeader doesn't support image file");
|
throw new ArgumentNullException(nameof(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string extension = Path.GetExtension(path).ToLower();
|
||||||
|
|
||||||
if (!SupportedExtensions.Contains(extension))
|
if (!SupportedExtensions.Contains(extension))
|
||||||
{
|
{
|
||||||
throw new ArgumentException("ImageHeader doesn't support " + extension);
|
throw new ArgumentException("ImageHeader doesn't support " + extension);
|
||||||
|
|
Loading…
Reference in a new issue