mirror of
https://github.com/Tichau/FileConverter.git
synced 2026-11-19 17:12:22 +01:00
Add progress update in ImageMagick conversions.
This commit is contained in:
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,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>
|
||||
Reference in new issue
Block a user