move crop whitespace directly to encode image

This commit is contained in:
Luke Pulverenti
2017-05-10 00:49:11 -04:00
parent 4569b6b491
commit f49d20033d
8 changed files with 187 additions and 230 deletions

View File

@@ -105,17 +105,6 @@ namespace Emby.Drawing.ImageMagick
}
}
public void CropWhiteSpace(string inputPath, string outputPath)
{
CheckDisposed();
using (var wand = new MagickWand(inputPath))
{
wand.CurrentImage.TrimImage(10);
wand.SaveImage(outputPath);
}
}
public ImageSize GetImageSize(string path)
{
CheckDisposed();
@@ -150,6 +139,11 @@ namespace Emby.Drawing.ImageMagick
{
using (var originalImage = new MagickWand(inputPath))
{
if (options.CropWhiteSpace)
{
originalImage.CurrentImage.TrimImage(10);
}
ScaleImage(originalImage, width, height, options.Blur ?? 0);
if (autoOrient)