diff --git a/src/Dianoga.Tests/Optimizers/Pipelines/DianogaSvg/SvgOptimizerTests.cs b/src/Dianoga.Tests/Optimizers/Pipelines/DianogaSvg/SvgOptimizerTests.cs index 5c7b34d7..a4a806cb 100644 --- a/src/Dianoga.Tests/Optimizers/Pipelines/DianogaSvg/SvgOptimizerTests.cs +++ b/src/Dianoga.Tests/Optimizers/Pipelines/DianogaSvg/SvgOptimizerTests.cs @@ -27,6 +27,16 @@ public void ShouldSquishSmallSvg() args.IsOptimized.Should().BeTrue(); } + [Fact] + public void ShouldSquishSmallSvgWithArgs() + { + Test(@"TestImages\small.svg", + @"..\..\..\..\Dianoga\Dianoga Tools\SVGO\svgop.exe", + "--disable=removeViewBox", out var args, out var startingSize); + args.Stream.Length.Should().BeLessThan(startingSize).And.BeGreaterThan(0); + args.IsOptimized.Should().BeTrue(); + } + [Fact] public void ShouldSquishLargeSvg() { diff --git a/src/Dianoga/Optimizers/Pipelines/DianogaSvg/SvgoOptimizer.cs b/src/Dianoga/Optimizers/Pipelines/DianogaSvg/SvgoOptimizer.cs index 6c568caa..e5d3a667 100644 --- a/src/Dianoga/Optimizers/Pipelines/DianogaSvg/SvgoOptimizer.cs +++ b/src/Dianoga/Optimizers/Pipelines/DianogaSvg/SvgoOptimizer.cs @@ -21,6 +21,7 @@ protected void ExecuteProcess(OptimizerArgs args) using (Process toolProcess = new Process()) { toolProcess.StartInfo.FileName = ExePath; + toolProcess.StartInfo.Arguments = AdditionalToolArguments; toolProcess.StartInfo.UseShellExecute = false; toolProcess.StartInfo.RedirectStandardInput = true; toolProcess.StartInfo.RedirectStandardOutput = true; @@ -30,7 +31,7 @@ protected void ExecuteProcess(OptimizerArgs args) toolProcess.ErrorDataReceived += (sender, eventArgs) => processOutput.Add(eventArgs.Data); #if DEBUG - Sitecore.Diagnostics.Log.Info($"\"{ExePath}\"", this); + Sitecore.Diagnostics.Log.Info($"\"{ExePath} {AdditionalToolArguments}\"", this); #endif try