improve image processing performance

This commit is contained in:
Luke Pulverenti
2017-12-01 12:04:32 -05:00
parent d7a1a87009
commit dec3b1bbb0
5 changed files with 80 additions and 34 deletions

View File

@@ -528,6 +528,7 @@ namespace Emby.Drawing.Skia
// If all we're doing is resizing then we can stop now
if (!hasBackgroundColor && !hasForegroundColor && blur == 0 && !hasIndicator)
{
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(outputPath));
using (var outputStream = new SKFileWStream(outputPath))
{
resizedBitmap.Encode(outputStream, skiaOutputFormat, quality);
@@ -580,6 +581,7 @@ namespace Emby.Drawing.Skia
DrawIndicator(canvas, width, height, options);
}
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(outputPath));
using (var outputStream = new SKFileWStream(outputPath))
{
saveBitmap.Encode(outputStream, skiaOutputFormat, quality);