neo4j-contrib / neoclipse

Graph Database Tool
218 stars 136 forks source link

Generate Windows icon for both Eclipse 3.4 and 4.2 launchers #56

Closed manandbytes closed 10 years ago

manandbytes commented 10 years ago

According to component that customizes the icon of a Windows .exe launcher [1], the Eclipse 3.4 launcher requires an .ico file with the 7 images (in any order):

A user icon matching exactly the width/height/depth of an executable icon will be written to the executable and will replace that executable icon. If an executable icon does not match a user icon, it is silently left as is.

Current neo.ico doesn't comply as it contains compressed images (through 3 to 7) and has no 24x24, 8 bit (256 colors) icon:

> identify -format '%f %p/%n %m %C/%Q %r %G %A %z\n' repository/icons/obj16/neo.ico
neo.ico 0/7 ICO Undefined/0 DirectClass sRGB Matte 48x48 True 8
neo.ico 1/7 ICO Undefined/0 DirectClass sRGB Matte 32x32 True 8
neo.ico 2/7 ICO Undefined/0 DirectClass sRGB Matte 16x16 True 8
neo.ico 3/7 ICO Zip/0 DirectClass sRGB Matte 256x256 True 8
neo.ico 4/7 ICO Zip/0 DirectClass sRGB Matte 48x48 True 32
neo.ico 5/7 ICO Zip/0 DirectClass sRGB Matte 32x32 True 32
neo.ico 6/7 ICO Zip/0 DirectClass sRGB Matte 16x16 True 32

Lets generate a new Windows icon using PNG icon from Neo4J Desktop [2], with ImageMagick:

> convert repository/icons/obj16/neo4j-icon_512x512.png -border 0 -compress None \
    \( -clone 0 -resize 16x16 -colors 256 -depth 8 \) \
    \( -clone 0 -resize 24x24 -colors 256 -depth 8 \) \
    \( -clone 0 -resize 32x32 -colors 256 -depth 8 \) \
    \( -clone 0 -resize 48x48 -colors 256 -depth 8 \) \
    \( -clone 0 -resize 16x16 -depth 24 \) \
    \( -clone 0 -resize 32x32 -depth 24 \) \
    \( -clone 0 -resize 48x48 -depth 24 \) \
    \( -clone 0 -resize 256x256 -depth 24 \) \
    -delete 0 -alpha off repository/icons/obj16/neo.ico

New icon has no compressed parts, includes missing 24x24, 8 bit (256 colors) icon and adds 256x256, 32 bit (RGB / Alpha Channel) icon for the Eclipse 4.2 launcher:

> identify -format '%f %p/%n %m %C/%Q %r %G %A %z\n' repository/icons/obj16/neo.ico
neo.ico 0/8 ICO Undefined/0 DirectClass sRGB Matte 16x16 True 8
neo.ico 1/8 ICO Undefined/0 DirectClass sRGB Matte 24x24 True 8
neo.ico 2/8 ICO Undefined/0 DirectClass sRGB Matte 32x32 True 8
neo.ico 3/8 ICO Undefined/0 DirectClass sRGB Matte 48x48 True 8
neo.ico 4/8 ICO Undefined/0 DirectClass sRGB Matte 16x16 True 32
neo.ico 5/8 ICO Undefined/0 DirectClass sRGB Matte 32x32 True 32
neo.ico 6/8 ICO Undefined/0 DirectClass sRGB Matte 48x48 True 32
neo.ico 7/8 ICO Undefined/0 DirectClass sRGB Matte 256x256 True 32

[1] http://git.eclipse.org/c/equinox/rt.equinox.p2.git/commit/?id=a2f9d54d4ec55e27d28b6c522a2940b309729f11 [2] /neo4j/packaging/neo4j-desktop/src/main/resources/neo4j-icon_512x512.png

manandbytes commented 10 years ago

At least, there are no more Error - 7 icon(s) not replaced message in the build log.

Sorry, have no such beast at my disposal :-) so could someone take a look if this approach really fixes the issue on Windows?

nawroth commented 10 years ago

I'll boot up a windows machine and have a look.