Magick.NET-Q16-AnyCPU (7.10.0) on .NET Core 2 has a strange behavior in button creation (from .svg file), on Windows works correctly but on Ubuntu doesn't. This is the problem:
Windows:
Link: http://pr0t3ck.altervista.org/images/Windows.JPG
Ubuntu:
Link: http://pr0t3ck.altervista.org/images/Ubuntu.JPG
Code:
Code: Select all
private static string SvgColor(string svgFile, string color = null, string bgcolor = null, decimal opacity = 1)
{
var gskinColor = new Dictionary<string, string>
{
{"&prcolor;", "fill:" + color},
{"&bgcolor;", "fill:" + bgcolor},
{"&opcty;", "1" /*opacity.ToString().Replace(",",".")*/}
};
var _svg = File.ReadAllText(svgFile);
foreach (var attribute in gskinColor)
_svg = _svg.Replace(attribute.Key, attribute.Value);
var svg = Encoding.ASCII.GetBytes(_svg);
var image = new MagickImage(svg);
image.Format = MagickFormat.Png;
var base64img = image.ToBase64();
image.Dispose();
return base64img;
}
4.4.0-87-generic #110-Ubuntu SMP
Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
dotnet version 2.1.4
Any suggest?
Thanks