aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs60
1 files changed, 30 insertions, 30 deletions
diff --git a/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs b/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
index 408d8c9b1..c6c1ec050 100644
--- a/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
+++ b/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
@@ -218,36 +218,36 @@ namespace MediaBrowser.Server.Implementations.Drawing
{
var hasPostProcessing = !string.IsNullOrEmpty(options.BackgroundColor) || options.UnplayedCount.HasValue || options.AddPlayedIndicator || options.PercentPlayed.HasValue;
- if (!hasPostProcessing)
- {
- using (var outputStream = await _mediaEncoder.EncodeImage(new ImageEncodingOptions
- {
- InputPath = originalImagePath,
- MaxHeight = options.MaxHeight,
- MaxWidth = options.MaxWidth,
- Height = options.Height,
- Width = options.Width,
- Quality = options.Quality,
- Format = options.OutputFormat == ImageOutputFormat.Original ? Path.GetExtension(originalImagePath).TrimStart('.') : options.OutputFormat.ToString().ToLower()
-
- }, CancellationToken.None).ConfigureAwait(false))
- {
- using (var outputMemoryStream = new MemoryStream())
- {
- // Save to the memory stream
- await outputStream.CopyToAsync(outputMemoryStream).ConfigureAwait(false);
-
- var bytes = outputMemoryStream.ToArray();
-
- await toStream.WriteAsync(bytes, 0, bytes.Length).ConfigureAwait(false);
-
- // kick off a task to cache the result
- await CacheResizedImage(cacheFilePath, bytes).ConfigureAwait(false);
- }
-
- return;
- }
- }
+ //if (!hasPostProcessing)
+ //{
+ // using (var outputStream = await _mediaEncoder.EncodeImage(new ImageEncodingOptions
+ // {
+ // InputPath = originalImagePath,
+ // MaxHeight = options.MaxHeight,
+ // MaxWidth = options.MaxWidth,
+ // Height = options.Height,
+ // Width = options.Width,
+ // Quality = options.Quality,
+ // Format = options.OutputFormat == ImageOutputFormat.Original ? Path.GetExtension(originalImagePath).TrimStart('.') : options.OutputFormat.ToString().ToLower()
+
+ // }, CancellationToken.None).ConfigureAwait(false))
+ // {
+ // using (var outputMemoryStream = new MemoryStream())
+ // {
+ // // Save to the memory stream
+ // await outputStream.CopyToAsync(outputMemoryStream).ConfigureAwait(false);
+
+ // var bytes = outputMemoryStream.ToArray();
+
+ // await toStream.WriteAsync(bytes, 0, bytes.Length).ConfigureAwait(false);
+
+ // // kick off a task to cache the result
+ // await CacheResizedImage(cacheFilePath, bytes).ConfigureAwait(false);
+ // }
+
+ // return;
+ // }
+ //}
using (var fileStream = _fileSystem.GetFileStream(originalImagePath, FileMode.Open, FileAccess.Read, FileShare.Read, true))
{