aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing
diff options
context:
space:
mode:
authorErwin de Haan <EraYaN@users.noreply.github.com>2019-01-13 21:31:14 +0100
committerErwin de Haan <EraYaN@users.noreply.github.com>2019-01-13 21:31:14 +0100
commita36658f6f0ed342d8b55dbf7c9ff95fe3abfa818 (patch)
treeb1484407efd83b243d0ea792b18c598e9ff53053 /Emby.Drawing
parent9fa60ec9340cbc8b4ed3e866fcf61852077902a1 (diff)
ReSharper Reformat: Properties to expression bodied form.
Diffstat (limited to 'Emby.Drawing')
-rw-r--r--Emby.Drawing/ImageProcessor.cs101
-rw-r--r--Emby.Drawing/NullImageEncoder.cs40
2 files changed, 49 insertions, 92 deletions
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs
index 5b9b15857..57a6eb148 100644
--- a/Emby.Drawing/ImageProcessor.cs
+++ b/Emby.Drawing/ImageProcessor.cs
@@ -74,7 +74,7 @@ namespace Emby.Drawing
public IImageEncoder ImageEncoder
{
- get { return _imageEncoder; }
+ get => _imageEncoder;
set
{
if (value == null)
@@ -86,67 +86,44 @@ namespace Emby.Drawing
}
}
- public string[] SupportedInputFormats
- {
- get
- {
- return new string[]
- {
- "tiff",
- "tif",
- "jpeg",
- "jpg",
- "png",
- "aiff",
- "cr2",
- "crw",
-
- // Remove until supported
- //"nef",
- "orf",
- "pef",
- "arw",
- "webp",
- "gif",
- "bmp",
- "erf",
- "raf",
- "rw2",
- "nrw",
- "dng",
- "ico",
- "astc",
- "ktx",
- "pkm",
- "wbmp"
- };
- }
- }
-
-
- public bool SupportsImageCollageCreation
- {
- get
- {
- return _imageEncoder.SupportsImageCollageCreation;
- }
- }
-
- private string ResizedImageCachePath
- {
- get
- {
- return Path.Combine(_appPaths.ImageCachePath, "resized-images");
- }
- }
-
- private string EnhancedImageCachePath
- {
- get
- {
- return Path.Combine(_appPaths.ImageCachePath, "enhanced-images");
- }
- }
+ public string[] SupportedInputFormats =>
+ new string[]
+ {
+ "tiff",
+ "tif",
+ "jpeg",
+ "jpg",
+ "png",
+ "aiff",
+ "cr2",
+ "crw",
+
+ // Remove until supported
+ //"nef",
+ "orf",
+ "pef",
+ "arw",
+ "webp",
+ "gif",
+ "bmp",
+ "erf",
+ "raf",
+ "rw2",
+ "nrw",
+ "dng",
+ "ico",
+ "astc",
+ "ktx",
+ "pkm",
+ "wbmp"
+ };
+
+
+ public bool SupportsImageCollageCreation => _imageEncoder.SupportsImageCollageCreation;
+
+ private string ResizedImageCachePath => Path.Combine(_appPaths.ImageCachePath, "resized-images");
+
+ private string EnhancedImageCachePath => Path.Combine(_appPaths.ImageCachePath, "enhanced-images");
public void AddParts(IEnumerable<IImageEnhancer> enhancers)
{
diff --git a/Emby.Drawing/NullImageEncoder.cs b/Emby.Drawing/NullImageEncoder.cs
index 748ae6f2c..e6f205a1f 100644
--- a/Emby.Drawing/NullImageEncoder.cs
+++ b/Emby.Drawing/NullImageEncoder.cs
@@ -6,26 +6,15 @@ namespace Emby.Drawing
{
public class NullImageEncoder : IImageEncoder
{
- public string[] SupportedInputFormats
- {
- get
+ public string[] SupportedInputFormats =>
+ new[]
{
- return new[]
- {
- "png",
- "jpeg",
- "jpg"
- };
- }
- }
+ "png",
+ "jpeg",
+ "jpg"
+ };
- public ImageFormat[] SupportedOutputFormats
- {
- get
- {
- return new[] { ImageFormat.Jpg, ImageFormat.Png };
- }
- }
+ public ImageFormat[] SupportedOutputFormats => new[] { ImageFormat.Jpg, ImageFormat.Png };
public void CropWhiteSpace(string inputPath, string outputPath)
{
@@ -42,20 +31,11 @@ namespace Emby.Drawing
throw new NotImplementedException();
}
- public string Name
- {
- get { return "Null Image Encoder"; }
- }
+ public string Name => "Null Image Encoder";
- public bool SupportsImageCollageCreation
- {
- get { return false; }
- }
+ public bool SupportsImageCollageCreation => false;
- public bool SupportsImageEncoding
- {
- get { return false; }
- }
+ public bool SupportsImageEncoding => false;
public ImageSize GetImageSize(string path)
{