Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
wieslawsoltes committed Dec 15, 2019
1 parent 55fea26 commit 3da7312
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 33 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ Options:
-s, --scale <scale> The output image horizontal and vertical scaling factor
-sx, --scaleX <scalex> The output image horizontal scaling factor
-sy, --scaleY <scaley> The output image vertical scaling factor
--debug Write debug output to a file
--quiet Set verbosity level to quiet
-c, --load-config <load-config> The relative or absolute path to the config file
--save-config <save-config> The relative or absolute path to the config file
Expand Down
2 changes: 1 addition & 1 deletion build/Base.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>0.0.1</VersionPrefix>
<VersionSuffix>preview.10</VersionSuffix>
<VersionSuffix></VersionSuffix>
<Authors>Wiesław Šoltés</Authors>
<Company>Wiesław Šoltés</Company>
<Copyright>Copyright © Wiesław Šoltés 2019</Copyright>
Expand Down
16 changes: 3 additions & 13 deletions src/Svg.Skia.Converter/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void Error(Exception ex)
}
}

public static bool Save(FileInfo path, DirectoryInfo? output, string format, int quality, string background, float scale, float scaleX, float scaleY, bool debug, bool quiet, int i)
public static bool Save(FileInfo path, DirectoryInfo? output, string format, int quality, string background, float scale, float scaleX, float scaleY, bool quiet, int i)
{
try
{
Expand All @@ -46,16 +46,6 @@ public static bool Save(FileInfo path, DirectoryInfo? output, string format, int
{
if (svg.Load(path.FullName) != null)
{
if (debug == true && svg.Document != null)
{
string ymlPath = path.FullName.Remove(path.FullName.Length - extension.Length) + ".yml";
if (output != null && !string.IsNullOrEmpty(output.FullName))
{
ymlPath = Path.Combine(output.FullName, Path.GetFileName(ymlPath));
}
SvgDebug.Print(svg.Document, ymlPath);
}

if (Enum.TryParse<SKEncodedImageFormat>(format, true, out var skEncodedImageFormat))
{
if (SKColor.TryParse(background, out var skBackgroundColor))
Expand Down Expand Up @@ -158,15 +148,15 @@ public static void Convert(ConverterSettings settings)
{
var path = paths[i];

if (Save(path, settings.Output, settings.Format, settings.Quality, settings.Background, settings.Scale, settings.ScaleX, settings.ScaleY, settings.Debug, settings.Quiet, i))
if (Save(path, settings.Output, settings.Format, settings.Quality, settings.Background, settings.Scale, settings.ScaleX, settings.ScaleY, settings.Quiet, i))
{
processed++;
}
}

sw.Stop();

if (settings.Quiet == false && paths.Count > 0)
if (paths.Count > 0)
{
Log($"Done: {sw.Elapsed} ({processed}/{paths.Count})");
}
Expand Down
1 change: 0 additions & 1 deletion src/Svg.Skia.Converter/ConverterSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class ConverterSettings
public float Scale { get; set; } = 1f;
public float ScaleX { get; set; } = 1f;
public float ScaleY { get; set; } = 1f;
public bool Debug { get; set; }
public bool Quiet { get; set; }
}
}
6 changes: 0 additions & 6 deletions src/Svg.Skia.Converter/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ public static async Task<int> Main(string[] args)
Argument = new Argument<float>(defaultValue: () => 1f)
};

var optionDebug = new Option(new[] { "--debug" }, "Write debug output to a file")
{
Argument = new Argument<bool>()
};

var optionQuiet = new Option(new[] { "--quiet" }, "Set verbosity level to quiet")
{
Argument = new Argument<bool>()
Expand Down Expand Up @@ -150,7 +145,6 @@ public static async Task<int> Main(string[] args)
rootCommand.AddOption(optionScale);
rootCommand.AddOption(optionScaleX);
rootCommand.AddOption(optionScaleY);
rootCommand.AddOption(optionDebug);
rootCommand.AddOption(optionQuiet);
rootCommand.AddOption(optionLoadConfig);
rootCommand.AddOption(optionSaveConfig);
Expand Down
11 changes: 0 additions & 11 deletions src/Svg.Skia/SKSvg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ public class SKSvg : IDisposable
{
public SKPicture? Picture { get; set; }

public SvgDocument? Document { get; set; }

internal SKPicture Load(SvgFragment svgFragment)
{
float width = svgFragment.Width.ToDeviceValue(null, UnitRenderingType.Horizontal, svgFragment);
Expand All @@ -34,7 +32,6 @@ internal SKPicture Load(SvgFragment svgFragment)
{
svgDocument.FlushStyles(true);
Picture = Load(svgDocument);
Document = svgDocument;
return Picture;
}
return null;
Expand All @@ -54,7 +51,6 @@ internal SKPicture Load(SvgFragment svgFragment)
{
svgDocument.FlushStyles(true);
Picture = Load(svgDocument);
Document = svgDocument;
return Picture;
}
return null;
Expand All @@ -81,7 +77,6 @@ internal SKPicture Load(SvgFragment svgFragment)
{
svgDocument.FlushStyles(true);
Picture = Load(svgDocument);
Document = svgDocument;
return Picture;
}
return null;
Expand All @@ -94,7 +89,6 @@ internal SKPicture Load(SvgFragment svgFragment)
{
svgDocument.FlushStyles(true);
Picture = Load(svgDocument);
Document = svgDocument;
return Picture;
}
return null;
Expand Down Expand Up @@ -155,11 +149,6 @@ public void Reset()
Picture.Dispose();
Picture = null;
}

if (Document != null)
{
Document = null;
}
}

public void Dispose()
Expand Down

0 comments on commit 3da7312

Please sign in to comment.