minigalaxy icon indicating copy to clipboard operation
minigalaxy copied to clipboard

Implement icon extraction from windows ico files

Open graag opened this issue 4 years ago • 6 comments

The PR is marked as a Draft as I'm not sure what would be the best way to handle required dependencies.

The idea is to extract a png icon for games that provide only goggame-*.ico, a png version would be useful for .desktop files. Current PR does not introduce any new mandatory dependencies and tries two approaches to extracting the icon:

  • use python pillow module if available as default extractor,
  • use imagemagick as a fallback.

There are two issues I would like to discuss:

  • The code could be simplified a lot if we would add pillow as mandatory dependency to requirements.txt, is that acceptable?
  • How to handle error messages? Which should remain as prints to the console and which should be displayed in a popup dialog? What about translations?

graag avatar Oct 03 '21 19:10 graag

Adding Pillow would be acceptable if it's needed. Do Gnome, KDE and other desktop environments not support using ico files as icons in .desktop files?

sharkwouter avatar Oct 06 '21 11:10 sharkwouter

In this case I would show an error message in the terminal, but not as a pop-up. Error messages in the terminal should not be translatable.

Adding Pillow as a dependency would make it so Imagemagick would not be needed, right?

sharkwouter avatar Oct 06 '21 11:10 sharkwouter

Adding Pillow would be acceptable if it's needed. Do Gnome, KDE and other desktop environments not support using ico files as icons in .desktop files?

Actually I did not test that lately - most of this is from my install script I've been using with lgogdownloader. The whole mess probably originated from problems with importing .desktop files to Steam. The icon is not set properly and the dialog window suggest only .png and .tga files.

I just tested with KDE and Steam and they both support .ico files. For KDE it looks like it selects the lowest resolution from the file - which we could improve by extracting a png.

graag avatar Oct 06 '21 13:10 graag

In this case I would show an error message in the terminal, but not as a pop-up. Error messages in the terminal should not be translatable.

OK

Adding Pillow as a dependency would make it so Imagemagick would not be needed, right?

Yes. With Pillow as a dependency the part with imagemagick could be dropped.

However it looks that it would be enough to point to proper .ico file - although KDE could select a better resolution.

graag avatar Oct 06 '21 13:10 graag

Oh that would be good. Much simpler too.

sharkwouter avatar Oct 06 '21 15:10 sharkwouter

@graag do you think this could be completed before the 7th of November? It would be nice to include it in the next release.

sharkwouter avatar Oct 20 '21 07:10 sharkwouter