Add progress update in ImageMagick conversions.

This commit is contained in:
Tichau committed 2016-02-11 18:52:32 +01:00
1 parent 0fd9e3d801
commit ffc81bc378
3 files changed
+12 -8

No files matched your search

@@ -36,6 +36,7 @@ namespace FileConverter.ConversionJobs
using (MagickImage image = new MagickImage(this.InputFilePath))
{
image.Progress += this.Image_Progress;
Debug.Log("Load image {0} succeed.", this.InputFilePath);
float scaleFactor = this.ConversionPreset.GetSettingsValue<float>(ConversionPreset.ConversionSettingKeys.ImageScale);
@@ -85,11 +86,18 @@ namespace FileConverter.ConversionJobs
default:
this.ConversionFailed(string.Format("Unsupported output format {0}.", this.ConversionPreset.OutputType));
image.Progress -= this.Image_Progress;
return;
}
image.Write(this.OutputFilePath);
image.Progress -= this.Image_Progress;
}
}
private void Image_Progress(object sender, ProgressEventArgs eventArgs)
{
this.Progress = (float)eventArgs.Progress.ToDouble() / 100f;
}
}
}
@@ -46,12 +46,8 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Accessibility" />
<Reference Include="Magick.NET-AnyCPU, Version=7.0.0.0, Culture=neutral, PublicKeyToken=2004825badfa91ec, processorArchitecture=MSIL">
<HintPath>..\..\packages\Magick.NET-Q16-AnyCPU.7.0.0.0022\lib\net40-client\Magick.NET-AnyCPU.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Magick.NET.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=2004825badfa91ec, processorArchitecture=MSIL">
<HintPath>..\..\packages\Magick.NET-Q16-AnyCPU.7.0.0.0022\lib\net40-client\Magick.NET.Core.dll</HintPath>
<Reference Include="Magick.NET-Q16-AnyCPU, Version=7.0.0.0, Culture=neutral, PublicKeyToken=2004825badfa91ec, processorArchitecture=MSIL">
<HintPath>..\..\packages\Magick.NET-Q16-AnyCPU.7.0.0.0101\lib\net40-client\Magick.NET-Q16-AnyCPU.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Markdown.Xaml">
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Magick.NET-Q16-AnyCPU" version="7.0.0.0022" targetFramework="net45" />
<package id="Magick.NET-Q16-AnyCPU" version="7.0.0.0101" targetFramework="net45" />
</packages>