Button edge shape issue

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
Stiff91x
Posts: 3
Joined: 2019-01-07T01:50:08-07:00
Authentication code: 1152

Button edge shape issue

Post 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
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Button edge shape issue

Post 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.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Stiff91x
Posts: 3
Joined: 2019-01-07T01:50:08-07:00
Authentication code: 1152

Re: Button edge shape issue

Post 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
Stiff91x
Posts: 3
Joined: 2019-01-07T01:50:08-07:00
Authentication code: 1152

Re: Button edge shape issue

Post by Stiff91x »

Ok, now it works (without ImageMagick :( )

Thanks anyway
Post Reply