proposal: add ksvg2ico

Review Request #129807 - Created Jan. 11, 2017 and updated

Information
René J.V. Bertin
kiconthemes
master
Reviewers
kdeframeworks, kdewin
alexmerry, cfeck, vonreth

Recently I committed a few changes to ecm_add_app_icon that make use of the fact that KIconThemes includes a ksvg2icns utility, making it possible to generate an application icon from an SVG file instead of from a series of PNG files.

With the present patch I propose to add an updated and extensively rewritten version of the ageing svg2ico tool from the KDEWin project to KIconThemes. The goal is to have a proper and up-to-date tool to generate application icons from SVG on MS Windows too.
This new version (named ksvg2ico in line with ksvg2icns) is a standalone tool that combines SVG - PNG conversion with PNG - ICO conversion. More accurately: it renders SVG files to an internal bitmap and then saves those bitmaps (as BMP?) to the .ico file.

  • it now handles sizes up to 256x256, in part thanks to syncing QtIcoHandler with the version from Qt 5.6 .
  • for that it uses a private copy of that class, with the unused read support disabled. Using Qt's internal version through QImageWriter isn't possible because that class doesn't yet support writing multiple images to a single file.
  • a --rcfile option is provided, copied from png2ico.
  • the PNG files are still saved and are left for debugging when --debug is given.

I considered proposing it to KDEWin instead, but in the end I liked the idea better to provide icon conversion utilities for Mac and Windows with a framework, where they might also serve in a less KDE-centric context (and cross-platform development).

On Mac OS X 10.9 and Linux with Qt 5.7.1 and KF5 5.29.0 .

Files


Issues

  • 0
  • 4
  • 1
  • 5
Description From Last Updated
Christoph Feck
Christoph Feck
René J.V. Bertin
René J.V. Bertin
René J.V. Bertin
René J.V. Bertin
Christoph Feck
René J.V. Bertin
René J.V. Bertin
Review request changed

Change Summary:

CMake file cleanup and Description update.

Description:

   

Recently I committed a few changes to ecm_add_app_icon that make use of the fact that KIconThemes includes a ksvg2icns utility, making it possible to generate an application icon from an SVG file instead of from a series of PNG files.

   
   

With the present patch I propose to add an updated and extensively rewritten version of the ageing svg2ico tool from the KDEWin project to KIconThemes. The goal is to have a proper and up-to-date tool to generate application icons from SVG on MS Windows too.

    This new version (named ksvg2ico in line with ksvg2icns) is a standalone tool that combines SVG - PNG conversion with PNG - ICO conversion. More accurately: it renders SVG files to an internal bitmap and then saves those bitmaps (as BMP?) to the .ico file.

   
~  
  • it now handles sizes up to 256x256, in part thanks to syncing QtIcoHandler with the version from Qt 5.7
~  
  • for that it uses a private copy of that class, with the unused read support disabled. (qicohandler.h isn't available on Mac and Linux so I cannot check building against Qt's internal version).
  ~
  • it now handles sizes up to 256x256, in part thanks to syncing QtIcoHandler with the version from Qt 5.6 .
  ~
  • for that it uses a private copy of that class, with the unused read support disabled. Using Qt's internal version through QImageWriter isn't possible because that class doesn't yet support writing multiple images to a single file.
   
  • a --rcfile option is provided, copied from png2ico.
   
  • the PNG files are still saved and are left for debugging when --debug is given.
   
   

I considered proposing it to KDEWin instead, but in the end I liked the idea better to provide icon conversion utilities for Mac and Windows with a framework, where they might also serve in a less KDE-centric context (and cross-platform development).

Testing Done:

~  

On Mac OS X 10.9 with Qt 5.7.1 and KF5 5.29.0 .

  ~

On Mac OS X 10.9 and Linux with Qt 5.7.1 and KF5 5.29.0 .

Diff:

Revision 5 (+1207)

Show changes

Loading...