aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing/ImageProcessor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
-rw-r--r--Emby.Drawing/ImageProcessor.cs18
1 files changed, 9 insertions, 9 deletions
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs
index 097b4c40b..1e4646227 100644
--- a/Emby.Drawing/ImageProcessor.cs
+++ b/Emby.Drawing/ImageProcessor.cs
@@ -83,8 +83,8 @@ namespace Emby.Drawing
}
}
- public string[] SupportedInputFormats =>
- new string[]
+ public IReadOnlyCollection<string> SupportedInputFormats =>
+ new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"tiff",
"tif",
@@ -137,14 +137,14 @@ namespace Emby.Drawing
}
}
- public ImageFormat[] GetSupportedImageOutputFormats()
- {
- return _imageEncoder.SupportedOutputFormats;
- }
+ public IReadOnlyCollection<ImageFormat> GetSupportedImageOutputFormats()
+ => _imageEncoder.SupportedOutputFormats;
+
+ private static readonly HashSet<string> TransparentImageTypes
+ = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { ".png", ".webp", ".gif" };
- private static readonly string[] TransparentImageTypes = new string[] { ".png", ".webp", ".gif" };
public bool SupportsTransparency(string path)
- => TransparentImageTypes.Contains(Path.GetExtension(path).ToLowerInvariant());
+ => TransparentImageTypes.Contains(Path.GetExtension(path));
public async Task<(string path, string mimeType, DateTime dateModified)> ProcessImage(ImageProcessingOptions options)
{
@@ -472,7 +472,7 @@ namespace Emby.Drawing
return (originalImagePath, dateModified);
}
- if (!_imageEncoder.SupportedInputFormats.Contains(inputFormat, StringComparer.OrdinalIgnoreCase))
+ if (!_imageEncoder.SupportedInputFormats.Contains(inputFormat))
{
try
{