correct dlna param positions

This commit is contained in:
Luke Pulverenti
2014-03-28 00:24:11 -04:00
parent 1664de62c0
commit ec49a65752
6 changed files with 96 additions and 66 deletions

View File

@@ -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()
//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);
// }, CancellationToken.None).ConfigureAwait(false))
// {
// using (var outputMemoryStream = new MemoryStream())
// {
// // Save to the memory stream
// await outputStream.CopyToAsync(outputMemoryStream).ConfigureAwait(false);
var bytes = outputMemoryStream.ToArray();
// var bytes = outputMemoryStream.ToArray();
await toStream.WriteAsync(bytes, 0, bytes.Length).ConfigureAwait(false);
// await toStream.WriteAsync(bytes, 0, bytes.Length).ConfigureAwait(false);
// kick off a task to cache the result
await CacheResizedImage(cacheFilePath, bytes).ConfigureAwait(false);
}
// // kick off a task to cache the result
// await CacheResizedImage(cacheFilePath, bytes).ConfigureAwait(false);
// }
return;
}
}
// return;
// }
//}
using (var fileStream = _fileSystem.GetFileStream(originalImagePath, FileMode.Open, FileAccess.Read, FileShare.Read, true))
{