Skip to content

Commit

Permalink
Merge pull request #20 from Tichau/development
Browse files Browse the repository at this point in the history
File Converter release v1.2.3
  • Loading branch information
Tichau authored Apr 29, 2017
2 parents 8494cb5 + 93b3818 commit b211b4a
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Application/FileConverter/Application.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public partial class Application : System.Windows.Application
{
Major = 1,
Minor = 2,
Patch = 2,
Patch = 3,
};

private readonly List<ConversionJob> conversionJobs = new List<ConversionJob>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace FileConverter.ConversionJobs
public class ConversionJob_ImageMagick : ConversionJob
{
private const float BaseDpiForPdfConversion = 200f;
private const int PdfSuperSamplingRatio = 1;

private bool isInputFilePdf;
private int pageCount;
Expand Down Expand Up @@ -95,7 +96,7 @@ private void ConvertPdf()
}

Debug.Log("Density: {0}dpi.", dpi);
settings.Density = new Density(dpi);
settings.Density = new Density(dpi * PdfSuperSamplingRatio);

this.UserState = Properties.Resources.ConversionStateReadDocument;

Expand All @@ -112,8 +113,14 @@ private void ConvertPdf()
foreach (MagickImage image in images)
{
Debug.Log("Write page {0}/{1}.", this.CurrentOuputFilePathIndex + 1, this.pageCount);
this.ConvertImage(image, true);

if (PdfSuperSamplingRatio > 1)
{
image.Scale(new Percentage(100 / PdfSuperSamplingRatio));
}

this.ConvertImage(image, true);

this.CurrentOuputFilePathIndex++;
}
}
Expand Down Expand Up @@ -181,7 +188,8 @@ private void ConvertImage(MagickImage image, bool ignoreScale = false)
switch (this.ConversionPreset.OutputType)
{
case OutputType.Png:
image.Quality = 100;
// http://stackoverflow.com/questions/27267073/imagemagick-lossless-max-compression-for-png
image.Quality = 95;
break;

case OutputType.Jpg:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace FileConverter
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Xml.Serialization;
Expand Down Expand Up @@ -378,7 +379,7 @@ public T GetSettingsValue<T>(string settingsKey)
return (T)System.Enum.Parse(type, settingsValue);
}

return (T)System.Convert.ChangeType(settingsValue, type);
return (T)System.Convert.ChangeType(settingsValue, type, NumberFormatInfo.InvariantInfo);
}

public bool IsRelevantSetting(string settingsKey)
Expand Down
18 changes: 12 additions & 6 deletions Application/FileConverter/FileConverter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,26 @@
</PropertyGroup>
<ItemGroup>
<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.2.900\lib\net40-client\Magick.NET-Q16-AnyCPU.dll</HintPath>
<HintPath>..\..\packages\Magick.NET-Q16-AnyCPU.7.0.5.502\lib\net40-client\Magick.NET-Q16-AnyCPU.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Markdown.Xaml">
<HintPath>..\..\Middleware\Markdown.Xaml.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Office.Interop.Excel.15.0.4795.1000\lib\net20\Microsoft.Office.Interop.Excel.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.Office.Interop.PowerPoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<Reference Include="Microsoft.Office.Interop.PowerPoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<HintPath>..\..\packages\Microsoft.Office.Interop.PowerPoint.12.0.4518.1014\lib\net20\Microsoft.Office.Interop.PowerPoint.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.Office.Interop.Word, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<Reference Include="Microsoft.Office.Interop.Word, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Office.Interop.Word.15.0.4797.1003\lib\net20\Microsoft.Office.Interop.Word.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="office, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<Reference Include="Office, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<HintPath>..\..\packages\Office.12.0.0\lib\net40\Office.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="PresentationUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
Expand Down Expand Up @@ -270,7 +274,9 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
6 changes: 5 additions & 1 deletion Application/FileConverter/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Magick.NET-Q16-AnyCPU" version="7.0.2.900" targetFramework="net45" />
<package id="Magick.NET-Q16-AnyCPU" version="7.0.5.502" targetFramework="net45" />
<package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1000" targetFramework="net45" />
<package id="Microsoft.Office.Interop.PowerPoint" version="12.0.4518.1014" targetFramework="net45" />
<package id="Microsoft.Office.Interop.Word" version="15.0.4797.1003" targetFramework="net45" />
<package id="Office" version="12.0.0" targetFramework="net45" />
<package id="WpfAnimatedGif" version="1.4.14" targetFramework="net45" />
</packages>
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Change Log

## Version 1.2.3
- Fixed: Issue where the scale were not working for image conversions depending on the application current language.
- Tech: Include office librairy dependencies in package config (now you don't need to install office to build the project).
- Tech: Upgrade ghostscript to version 9.21.
- Tech: Update ImageMagick to version 7.0.5.

## Version 1.2.2
- New: Portuguese translation (thanks to Khidreal).
- Added: Portuguese translation (thanks to Khidreal).
- Fixed: Issue where scale was corrupted when switching application language (github issue #5).
- Fixed: Issue where file metadata were not copied when converting to aac format (github issue #15).
- Tech: Update to ffmpeg 3.2.2 version.
Expand Down
2 changes: 1 addition & 1 deletion Installer/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<!-- Upgrade documentation: http://wixtoolset.org/documentation/manual/v3/howtos/updates/major_upgrade.html -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="$(var.ProductName)" Language="1033" Version="1.2.2" Manufacturer="Adrien Allard" UpgradeCode="e3ca717b-a897-418a-bbef-5c7e35c76e4b">
<Product Id="*" Name="$(var.ProductName)" Language="1033" Version="1.2.3" Manufacturer="Adrien Allard" UpgradeCode="e3ca717b-a897-418a-bbef-5c7e35c76e4b">
<?if $(var.Platform) = x64 ?>
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64" />
<?else ?>
Expand Down
Binary file modified Middleware/gs/x86/gsdll32.dll
Binary file not shown.
Binary file modified Middleware/gs/x86/gswin32c.exe
Binary file not shown.

0 comments on commit b211b4a

Please sign in to comment.