hardcode-fixer icon indicating copy to clipboard operation
hardcode-fixer copied to clipboard

Dealing with Invalid Icon Formats

Open Foggalong opened this issue 8 years ago • 1 comments

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 avatar Sep 05 '17 14:09 Foggalong

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

bilelmoussaoui avatar Sep 05 '17 14:09 bilelmoussaoui