Review Request 129807: proposal: add ksvg2ico

René J.V. Bertin rjvbertin at gmail.com
Fri Jan 13 12:22:48 UTC 2017


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129807/
-----------------------------------------------------------

(Updated Jan. 13, 2017, 1:22 p.m.)


Review request for KDE Frameworks, kdewin, Alex Merry, Christoph Feck, and Hannah von Reth.


Changes
-------

Now using QtIcoHandler from Qt 5.6.2 which has the same LGPL 2.1 as the rest of ksvg2ico and should be fine.

I'm investigating using `QImageWriter` though, no need to maintain extra code if it is already available in Qt itself.


Repository: kiconthemes


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).
- 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).


Diffs (updated)
-----

  src/CMakeLists.txt efba9e6 
  src/tools/ksvg2ico/CMakeLists.txt PRE-CREATION 
  src/tools/ksvg2ico/ksvg2ico.cpp PRE-CREATION 
  src/tools/ksvg2ico/qicohandler.h PRE-CREATION 
  src/tools/ksvg2ico/qicohandler.cpp PRE-CREATION 

Diff: https://git.reviewboard.kde.org/r/129807/diff/


Testing
-------

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


File Attachments
----------------

.ico file generated from sc-apps-calligrakarbon.svgz using ksvg2ico with Benkmann's png2ico
  https://git.reviewboard.kde.org/media/uploaded/files/2017/01/11/aa0973dc-1be8-4d36-82dc-8f7baa053fee__apps-calligrakarbon.ico
.ico created by icotool from *-apps-calligrakarbon.png
  https://git.reviewboard.kde.org/media/uploaded/files/2017/01/12/3bbee1f5-6770-4d6e-847d-e32c7e5d3fe1__icotool-apps-calligrakarbon.png
ico file generated by the standalone ksvg2ico
  https://git.reviewboard.kde.org/media/uploaded/files/2017/01/12/7b286997-3100-47d0-800e-acb56ee9c68f__apps-calligrakarbon.ico


Thanks,

René J.V. Bertin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-windows/attachments/20170113/6639c33f/attachment.html>


More information about the Kde-windows mailing list