Skip to content

Commit

Permalink
Revert WithInkscapeEnabled due to changes in ImageMagick.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Feb 24, 2024
1 parent 3ae87c1 commit 9c11be7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 109 deletions.
6 changes: 0 additions & 6 deletions src/Magick.NET.Core/Configuration/IConfigurationFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,4 @@ public interface IConfigurationFiles
/// Gets the type-ghostscript configuration.
/// </summary>
IConfigurationFile TypeGhostscript { get; }

/// <summary>
/// Creates a new configuration with Inkscape enabled.
/// </summary>
/// <returns>A new configuration with Inkscape enabled.</returns>
public IConfigurationFiles WithInkscapeEnabled();
}
6 changes: 0 additions & 6 deletions src/Magick.NET/Configuration/ConfigurationFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ public ConfigurationFile(string fileName)
Data = LoadData();
}

public ConfigurationFile(IConfigurationFile configurationFile)
{
FileName = configurationFile.FileName;
Data = configurationFile.Data;
}

public string FileName { get; }

public string Data { get; set; }
Expand Down
66 changes: 12 additions & 54 deletions src/Magick.NET/Configuration/ConfigurationFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,25 @@ namespace ImageMagick.Configuration;
/// </summary>
public sealed class ConfigurationFiles : IConfigurationFiles
{
private ConfigurationFiles(
IConfigurationFile colors,
IConfigurationFile configure,
IConfigurationFile delegates,
IConfigurationFile english,
IConfigurationFile locale,
IConfigurationFile log,
IConfigurationFile policy,
IConfigurationFile thresholds,
IConfigurationFile type,
IConfigurationFile typeGhostscript)
private ConfigurationFiles()
{
Colors = colors;
Configure = configure;
Delegates = delegates;
English = english;
Locale = locale;
Log = log;
Policy = policy;
Thresholds = thresholds;
Type = type;
TypeGhostscript = typeGhostscript;
Colors = new ConfigurationFile("colors.xml");
Configure = new ConfigurationFile("configure.xml");
Delegates = new ConfigurationFile("delegates.xml");
English = new ConfigurationFile("english.xml");
Locale = new ConfigurationFile("locale.xml");
Log = new ConfigurationFile("log.xml");
Policy = new ConfigurationFile("policy.xml");
Thresholds = new ConfigurationFile("thresholds.xml");
Type = new ConfigurationFile("type.xml");
TypeGhostscript = new ConfigurationFile("type-ghostscript.xml");
}

/// <summary>
/// Gets the default configuration.
/// </summary>
public static IConfigurationFiles Default
=> new ConfigurationFiles(
colors: new ConfigurationFile("colors.xml"),
configure: new ConfigurationFile("configure.xml"),
delegates: new ConfigurationFile("delegates.xml"),
english: new ConfigurationFile("english.xml"),
locale: new ConfigurationFile("locale.xml"),
log: new ConfigurationFile("log.xml"),
policy: new ConfigurationFile("policy.xml"),
thresholds: new ConfigurationFile("thresholds.xml"),
type: new ConfigurationFile("type.xml"),
typeGhostscript: new ConfigurationFile("type-ghostscript.xml"));
=> new ConfigurationFiles();

/// <summary>
/// Gets all the configuration files.
Expand Down Expand Up @@ -125,26 +105,4 @@ IConfigurationFiles IConfigurationFiles.Default
/// Gets the type-ghostscript configuration.
/// </summary>
public IConfigurationFile TypeGhostscript { get; }

/// <summary>
/// Creates a new configuration with Inkscape enabled.
/// </summary>
/// <returns>A new configuration with Inkscape enabled.</returns>
public IConfigurationFiles WithInkscapeEnabled()
{
var delegates = new ConfigurationFile(Delegates);
delegates.Data = delegates.Data.Replace(@"<!--<delegate decode=""svg:decode"" stealth=""True"" command=""&quot;inkscape&quot; &quot;%s&quot; - -export-filename=&quot;%s&quot; - -export-dpi=&quot;%s&quot; - -export-background=&quot;%s&quot; - -export-background-opacity=&quot;%s&quot; &gt; &quot;%s&quot; 2&gt;&amp;1""/>-->", @"<delegate decode=""svg:decode"" stealth=""True"" command=""&quot;inkscape&quot; &quot;%s&quot; --export-filename=&quot;%s&quot; --export-dpi=&quot;%s&quot; --export-background=&quot;%s&quot; --export-background-opacity=&quot;%s&quot; &gt; &quot;%s&quot; 2&gt;&amp;1""/>");

return new ConfigurationFiles(
colors: new ConfigurationFile(Colors),
configure: new ConfigurationFile(Configure),
delegates: new ConfigurationFile(delegates),
english: new ConfigurationFile(English),
locale: new ConfigurationFile(Locale),
log: new ConfigurationFile(Log),
policy: new ConfigurationFile(Policy),
thresholds: new ConfigurationFile(Thresholds),
type: new ConfigurationFile(Type),
typeGhostscript: new ConfigurationFile(TypeGhostscript));
}
}

This file was deleted.

0 comments on commit 9c11be7

Please sign in to comment.