Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with Invalid Icon Formats #306

Open
Foggalong opened this issue Sep 5, 2017 · 1 comment
Open

Dealing with Invalid Icon Formats #306

Foggalong opened this issue Sep 5, 2017 · 1 comment
Labels

Comments

@Foggalong
Copy link
Owner

This is a continued discussion from #305 about a bug discovered there. Say an launcher has the icon line

Icon=/usr/local/share/lib/BQ/BQ_Firmware_Flash_Tool/images/64_border.ico

which we correct to

Icon=bq-tool

then the script in its current format will copy that ico file to bq-tool in the hicolor folder. However the icon lookup spec only supports the svg, png, and xpm image formats. This means that unless an icon theme is applied which contains a bq-tool icon, the system will fail to pickup the bq-tool.ico icon and the launcher will appear broken.

Possible resolutions to this are:

  1. Don't fix hardcoded icons which are in an invalid format, and print a message informing the user
  2. Include a conversion script to convert from invalid formats to valid ones, and make the script

The former has the disadvantage that the launcher in question remains unfixed and the latter has the disadvantage that it will introduce a great deal of complexity to the code (dealing with every possible invalid format).

@Foggalong Foggalong added the bug label Sep 5, 2017
@bilelmoussaoui
Copy link
Contributor

I don't think there's a lot of invalid/unsupported icons extensions other than ico. The jpeg icons are not transparent, which makes it really hard to create a logo without transparency. Unless the logo is a square?
Anyway, imagemagick, supports a lot extensions that you can convert from like jpeg, ico....So it shouldn't be any harder, you just need to get the extension before copying the icon if it's a valid extension copy it, if not use imagemagick to convert the icon and export it directly to the correct location

SmartFinn added a commit to SmartFinn/hardcode-fixer that referenced this issue Nov 13, 2017
@SmartFinn SmartFinn mentioned this issue Nov 13, 2017
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants