Page 1 of 1

Button edge shape issue

Posted: 2019-01-07T02:49:51-07:00
by Stiff91x
Hi guys,
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:
Image
Link: http://pr0t3ck.altervista.org/images/Windows.JPG

Ubuntu:
Image
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;
        }
Linux version:
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

Re: Button edge shape issue

Posted: 2019-01-07T15:42:25-07:00
by dlemstra
I suspect that you are using the build in MSVG coder on Ubuntu and on Windows you are using librsvg. You probably want to install inkspace on your Linux machine to get better SVG output.

Re: Button edge shape issue

Posted: 2019-01-08T01:43:27-07:00
by Stiff91x
dlemstra wrote: 2019-01-07T15:42:25-07:00 I suspect that you are using the build in MSVG coder on Ubuntu and on Windows you are using librsvg. You probably want to install inkspace on your Linux machine to get better SVG output.
Mmmh it's not clear for me sorry, could you be more detailed? I install librsvg but doesn't work again (i think because i dunno how change MSVG coder in Ubuntu) and Inkspace is a software, how could it help me? Replace the coder itself? If is possible i prefer to install standalone library and not software

Thanks

Re: Button edge shape issue

Posted: 2019-01-08T03:24:29-07:00
by Stiff91x
Ok, now it works (without ImageMagick :( )

Thanks anyway