minigalaxy
minigalaxy copied to clipboard
Implement icon extraction from windows ico files
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
pillowas mandatory dependency torequirements.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?
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?
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?
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.
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.
Oh that would be good. Much simpler too.
@graag do you think this could be completed before the 7th of November? It would be nice to include it in the next release.