aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing/ImageProcessor.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-12-02 15:10:35 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-12-02 15:10:35 -0500
commitaef79a796dd029849f3d99c4b59d3652bd83b4a9 (patch)
treeb1de73488da139940a64e153fbc369f2dbf44bec /Emby.Drawing/ImageProcessor.cs
parent12ff39eeafd7bfe81b7d3dd4d3046b5640e33495 (diff)
update xml parsing
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
-rw-r--r--Emby.Drawing/ImageProcessor.cs27
1 files changed, 3 insertions, 24 deletions
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs
index 292896856..2224d544c 100644
--- a/Emby.Drawing/ImageProcessor.cs
+++ b/Emby.Drawing/ImageProcessor.cs
@@ -432,17 +432,12 @@ namespace Emby.Drawing
return GetResult(croppedImagePath);
}
- var imageProcessingLockTaken = false;
-
try
{
_fileSystem.CreateDirectory(Path.GetDirectoryName(croppedImagePath));
var tmpPath = Path.ChangeExtension(Path.Combine(_appPaths.TempDirectory, Guid.NewGuid().ToString("N")), Path.GetExtension(croppedImagePath));
_fileSystem.CreateDirectory(Path.GetDirectoryName(tmpPath));
- await _imageProcessingSemaphore.WaitAsync().ConfigureAwait(false);
- imageProcessingLockTaken = true;
-
_imageEncoder.CropWhiteSpace(originalImagePath, tmpPath);
CopyFile(tmpPath, croppedImagePath);
return GetResult(tmpPath);
@@ -459,13 +454,6 @@ namespace Emby.Drawing
return new Tuple<string, DateTime>(originalImagePath, dateModified);
}
- finally
- {
- if (imageProcessingLockTaken)
- {
- _imageProcessingSemaphore.Release();
- }
- }
}
private Tuple<string, DateTime> GetResult(string path)
@@ -904,20 +892,11 @@ namespace Emby.Drawing
public async Task CreateImageCollage(ImageCollageOptions options)
{
- await _imageProcessingSemaphore.WaitAsync().ConfigureAwait(false);
+ _logger.Info("Creating image collage and saving to {0}", options.OutputPath);
- try
- {
- _logger.Info("Creating image collage and saving to {0}", options.OutputPath);
+ _imageEncoder.CreateImageCollage(options);
- _imageEncoder.CreateImageCollage(options);
-
- _logger.Info("Completed creation of image collage and saved to {0}", options.OutputPath);
- }
- finally
- {
- _imageProcessingSemaphore.Release();
- }
+ _logger.Info("Completed creation of image collage and saved to {0}", options.OutputPath);
}
public IEnumerable<IImageEnhancer> GetSupportedEnhancers(IHasImages item, ImageType imageType)