Weathermap Editor 0.9 Problem

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

submarine wrote:One could replace the half-red color by magenta :

Code: Select all

$nothing=imagecolorallocate($node_im, 255, 0, 255); 
I doubt there are a lot of images/icons using that one. :wink:
No, but it is in the default SCALE, so if you we using node targets, that would become transparent. I suspect the "best" answer is some much more random colour like 13,99,201, but it's still second best to actual working alpha support (not just transparency). I'll add the SET option in 0.91, so folks who are stuck with this can enable it.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
iharvey
Posts: 42
Joined: Wed Nov 01, 2006 6:10 am

Post by iharvey »

This is to fix the Debian GD library problem:

download libgd2-xpm_2.0.34~rc1-2_i386.deb

(it is available from ftp.debian.org/debian/pool/main/libg/libgd2/libgd2-xpm_2.0.34~rc1-2_i386.deb)

run the following:

dpkg -i libgd2-xpm_2.0.34~rc1-2_i386.deb

I then did a reboot and now I can use the original line ($nothing=imagecolorallocatealpha($node_im, 128, 0, 0,127);) and have transparency

Many thanks again! :D
iharvey
Posts: 42
Joined: Wed Nov 01, 2006 6:10 am

Post by iharvey »

And without the fixed GD library, the following lines changed/added in Weathermap.class.php (as you suggested) work well too:

(first line is line number 1155)

#$nothing=imagecolorallocatealpha($node_im,128,0,0,127);
#$nothing=imagecolorallocate($node_im, 128, 0, 0);
$nothing=imagecolorallocate($node_im, 255, 0, 255);
imagefill($node_im, 0, 0, $nothing);
imagecolortransparent($node_im, $nothing);
submarine
Posts: 6
Joined: Wed May 02, 2007 9:42 am

Post by submarine »

Hi.

I've been busy with that alpha. So I tried to replace the following code :

Code: Select all

// create an image of that size and draw into it
$node_im=imagecreatetruecolor($bbox_x2 - $bbox_x1 , $bbox_y2 - $bbox_y1 );
imageSaveAlpha($node_im, true);
// ImageAlphaBlending($node_im, true);
$nothing=imagecolorallocatealpha($node_im,128,0,0,127);
imagefill($node_im, 0, 0, $nothing);
by this one :

Code: Select all

$temp_width = $bbox_x2 - $bbox_x1;
$temp_height = $bbox_y2 - $bbox_y1;
$node_im=imagecreatetruecolor($temp_width , $temp_height );               

imagealphablending($node_im, FALSE);
imagesavealpha($node_im,TRUE); 
$nothing = imagecolorexactalpha($node_im,128,0,0,127);
imagefilledrectangle($node_im,0,0,$temp_width,$temp_height,$nothing);
It seems to work. Can someone confirm this, please ?
iharvey
Posts: 42
Joined: Wed Nov 01, 2006 6:10 am

Post by iharvey »

Tested and working - good job!
submarine
Posts: 6
Joined: Wed May 02, 2007 9:42 am

Post by submarine »

iharvey wrote:Tested and working - good job!
Thanks ! :D
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests