cosmetic issues with gd2 icons

Thomas Guyot-Sionnest thomas at zango.com
Tue May 6 16:26:12 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Guillaume Rousse wrote:
| hello list.
|
| I've made my own icon for netapp filers, using the new netapp logo. I've
| used a png icon with a transparent background as the master icon, and
| converted it with pngtogd2 util, with the following command:
| pngtogd2 logo.png logo.gd2 0 1
|
| The png icon is fine, but the gd2 icon background appears as solid black
| area on the status map. I've tried various png saving options in gimp
| without success. Does anyone have a clue here to make it transparent as
| other icons ?


I use the script below to generate my icons. Obviously any format that
can be converted to pnm will work; here it's .gif. I believe Nagios
needs the .gif somehow, so you should avoid alpha channel (or make one
non-alpha .gif version, and one png with alpha channel). I have no idea
if gd2 supports alpha though.

Run it as ./genicon.sh <gif files...>
i.e.: "./genicon.sh *.gif" will convert all .gif files in current directory.

Be aware that it will clobber any .pnm, .png, .jpg and .gd2 with the
same names as the source files without warning.

- ----- genicon.sh -----
path="/usr/bin"

for arg
do
~  if [ -f "$arg" ]; then
~    echo converting $arg
~    arg="$(echo $arg | sed 's/\.gif$//')"
~    $path/giftopnm $arg.gif > $arg.pnm
~    $path/pnmtopng -transparent rgb:ff/ff/ff $arg.pnm > $arg.png
~    $path/pnmtojpeg -quality=100 -optimize -smooth=0 $arg.pnm > $arg.jpg
~    $path/pngtogd2 $arg.png $arg.gd2 0 1
~  fi
done

rm -f *.pnm
- ----- END -----

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIIGqE6dZ+Kt5BchYRAhTUAKCvlq11nhdQ2/+PB3ujOJJavhj28gCeNCLt
RJHPGagNSjQ/4PvpWmyBo3Q=
=m7nt
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone




More information about the Developers mailing list