[libvirt] [PATCH] Add a Windows icon resource to virsh.exe

This patch adds a Windows resource icon to virsh.exe (on Windows only, obviously). I've generated 16x16, 32x32, 48x48 and 64x64 MS .ico files, starting from Diana Fong / Tim Allen's libvirtLogo.png in the docs directory, scaling it down to the required size, and adding an alpha mask. The *.ico files have to go into the src directory, because of limitations of the Microsoft resource editor file format itself. I propose to add the 64x64 PNG file into the docs directory, or perhaps not bother adding it at all -- it's not actually used and can be quite trivially recreated. My graphical attempts are fairly lame. This is partly because these icons really need to be tweaked by hand for legibility at small sizes, and partly because Windows itself does some quantization on the .ico files after loading them. This quantization I don't understand and isn't documented anywhere. Nevertheless the icon looks not totally unreasonable, as you can see from the final screenshot attached. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my OCaml programming blog: http://camltastic.blogspot.com/ Fedora now supports 68 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora

On Wed, Oct 15, 2008 at 05:37:51PM +0100, Richard W.M. Jones wrote:
This patch adds a Windows resource icon to virsh.exe (on Windows only, obviously).
I've generated 16x16, 32x32, 48x48 and 64x64 MS .ico files, starting from Diana Fong / Tim Allen's libvirtLogo.png in the docs directory, scaling it down to the required size, and adding an alpha mask.
The *.ico files have to go into the src directory, because of limitations of the Microsoft resource editor file format itself. I propose to add the 64x64 PNG file into the docs directory, or perhaps not bother adding it at all -- it's not actually used and can be quite trivially recreated.
My graphical attempts are fairly lame. This is partly because these icons really need to be tweaked by hand for legibility at small sizes, and partly because Windows itself does some quantization on the .ico files after loading them. This quantization I don't understand and isn't documented anywhere. Nevertheless the icon looks not totally unreasonable, as you can see from the final screenshot attached.
What color depth did you create the icons at ? This blog posts suggest the problem is more horrific than you can possibly imagine, requiring a total of 12 icons to be provided for proper Windows compatability http://frankieloscavio.blogspot.com/2007/10/ico-files-and-how-they-work-usin... And apparently all the different versions should be in the same .ICO file ?!?! Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Wed, Oct 15, 2008 at 05:49:06PM +0100, Daniel P. Berrange wrote:
What color depth did you create the icons at ?
32 bits (in GIMP).
This blog posts suggest the problem is more horrific than you can possibly imagine, requiring a total of 12 icons to be provided for proper Windows compatability
http://frankieloscavio.blogspot.com/2007/10/ico-files-and-how-they-work-usin...
And apparently all the different versions should be in the same .ICO file ?!?!
Uurrgghhhh. I'm quite sure there used to be programs to generate and manipulate ICO files from Linux but I can't find any at the moment. It doesn't necessarily matter if all the icons are combined into a single file or not, because i686-pc-mingw32-windres combines everything into a single resource object (a COFF object file) which gets linked to the final executable. Suggest that we add the patch & icons as-is and let people who use Vista and/or are graphic designers deal with this in the future? Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top

On Wed, Oct 15, 2008 at 05:59:59PM +0100, Richard W.M. Jones wrote:
On Wed, Oct 15, 2008 at 05:49:06PM +0100, Daniel P. Berrange wrote:
What color depth did you create the icons at ?
32 bits (in GIMP).
This blog posts suggest the problem is more horrific than you can possibly imagine, requiring a total of 12 icons to be provided for proper Windows compatability
http://frankieloscavio.blogspot.com/2007/10/ico-files-and-how-they-work-usin...
And apparently all the different versions should be in the same .ICO file ?!?!
Uurrgghhhh.
I'm quite sure there used to be programs to generate and manipulate ICO files from Linux but I can't find any at the moment. It doesn't necessarily matter if all the icons are combined into a single file or not, because i686-pc-mingw32-windres combines everything into a single resource object (a COFF object file) which gets linked to the final executable.
Suggest that we add the patch & icons as-is and let people who use Vista and/or are graphic designers deal with this in the future?
Yep, its an incremental improvement over nothing, so no objections to commiting this as a starting point. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (2)
-
Daniel P. Berrange
-
Richard W.M. Jones