matter icon indicating copy to clipboard operation
matter copied to clipboard

Bundle svg converter into Matter

Open mateosss opened this issue 5 years ago • 10 comments

As of now Matter has two dependencies.

  • ImageMagick: which brings the convert command for convertig icons in svg to png
  • Inkscape: big in size but improves the default ImageMagick svg converter a lot, without it, icons usually look odd.

These packages seem to be bringing a lot of trouble, it would be great to have an svg converter bundled directly into Matter so that there would be no more problems with dependencies.

mateosss avatar Sep 28 '20 16:09 mateosss

Do you want to replace the external dependency on the command convert with a library to use inside the python script, right? If you want to assign this issue to me I can take care of it.

dexpota avatar Sep 30 '20 13:09 dexpota

Yes! the target is to

  • Reduce dependencies for the user, in size and quantity
  • Still get good quality conversions that look well on grub

I'll assign this issue to you then. Thanks!

mateosss avatar Sep 30 '20 14:09 mateosss

Hi, are there any updates to this issue? I have weird problem with the icons on the grub menu. Icons that are more complex, such as Windows and Ubuntu are not being converted properly.

out

I digged around and found out this problem is due to ImageMagick's convert command not working properly, not a bug in Matter. I am putting this issue here because this bug should go away if Matter's dependency on ImageMagick is removed.

heyzec avatar Mar 14 '21 06:03 heyzec

Do you have Inkscape installed? ImageMagick tries to use the Inkscape SVG converter and if it does not find it uses its own converter which is not the best. Your PNG output looks like it is not using Inkscape's converter.

See https://github.com/ImageMagick/ImageMagick/discussions/2216 for more information about that.

mateosss avatar Mar 14 '21 12:03 mateosss

You were right, using --verbose on the convert command showed it was using its internal converter and not inkscape, which was least expected to me because I have inkscape installed. I spend two hours figuring out how to get it to use inkscape (including building ImageMagick-7 from source, using the Magick's AppImage and tweaking the delegates config) to no avail. I shall patiently wait for matter's own converter to be bundled instead :D

heyzec avatar Mar 15 '21 13:03 heyzec

Oof! Sorry for that, what distro are you using? Maybe it would be better to open a new issue for tracking this particular problem.

mateosss avatar Mar 15 '21 18:03 mateosss

I've got a partial solution to remove the ImageMagick dependency. Do take a look at this branch :D

heyzec avatar Mar 31 '21 14:03 heyzec

That's very nice!

mateosss avatar Mar 31 '21 23:03 mateosss

What do you think about the lxml dependency required?

heyzec avatar Apr 02 '21 04:04 heyzec

I think it would be better to use the xml package that is part of the standard library.

Though if there is a reason for using lxml instead let me know.

mateosss avatar Apr 02 '21 12:04 mateosss