From 06ed4e03676ca8087cc40ca3d018b96a055a3b96 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Sun, 11 Jan 2004 08:36:56 +0000 Subject: Better check for function imagecreatetruecolor() git-svn-id: svn://svn.zabbix.com/trunk@1167 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/classes.inc.php | 4 ++-- frontends/php/include/config.inc.php | 2 +- frontends/php/map.php | 6 +++--- frontends/php/sysmap.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontends/php/include/classes.inc.php b/frontends/php/include/classes.inc.php index a01470f6..094badca 100644 --- a/frontends/php/include/classes.inc.php +++ b/frontends/php/include/classes.inc.php @@ -54,7 +54,7 @@ function initColors() { // I should rename No Alpha to Alpha at some point to get rid of some confusion - if(function_exists("ImageColorExactAlpha")&&function_exists("ImageCreateTrueColor")) + if(function_exists("ImageColorExactAlpha")&&function_exists("ImageCreateTrueColor")&&@imagecreatetruecolor(1,1)) { $this->colors["Red"]= ImageColorExactAlpha($this->im,255,0,0,50); $this->colors["Dark Red"]= ImageColorExactAlpha($this->im,150,0,0,50); @@ -505,7 +505,7 @@ check_authorisation(); - if(function_exists("ImageColorExactAlpha")&&function_exists("ImageCreateTrueColor")) + if(function_exists("ImageColorExactAlpha")&&function_exists("ImageCreateTrueColor")&&@imagecreatetruecolor(1,1)) { $this->im = ImageCreateTrueColor($this->sizeX+$this->shiftX+61,$this->sizeY+$this->shiftY+62+12*$this->num+8); } diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 5d9024f0..2f23c18d 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -4943,7 +4943,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; if( ($status==0)||($status==2)) { - if(function_exists("imagecreatetruecolor")) + if(function_exists("imagecreatetruecolor")&&@imagecreatetruecolor(1,1)) { $map=$map."\n\"$host\""; } diff --git a/frontends/php/map.php b/frontends/php/map.php index 4d60c7a6..56e60937 100644 --- a/frontends/php/map.php +++ b/frontends/php/map.php @@ -40,7 +40,7 @@ check_authorisation(); - if(function_exists("imagecreatetruecolor")) + if(function_exists("imagecreatetruecolor")&&@imagecreatetruecolor(1,1)) { $im = imagecreatetruecolor($width,$height); } @@ -135,7 +135,7 @@ $x2=DBget_field($result1,0,0); $y2=DBget_field($result1,0,1); - if(function_exists("imagecreatetruecolor")) + if(function_exists("imagecreatetruecolor")&&@imagecreatetruecolor(1,1)) { $size=48/2; } @@ -203,7 +203,7 @@ if(@gettype($icons["$icon"])!="resource") { - if(function_exists("imagecreatetruecolor")) + if(function_exists("imagecreatetruecolor")&&@imagecreatetruecolor(1,1)) { $icons[$icon]=ImageCreateFromPNG("images/sysmaps/$icon.png"); } diff --git a/frontends/php/sysmap.php b/frontends/php/sysmap.php index 0c7e77bf..60102b8e 100644 --- a/frontends/php/sysmap.php +++ b/frontends/php/sysmap.php @@ -95,7 +95,7 @@ $y_=DBget_field($result,$i,6); $status_=DBget_field($result,$i,7); - if(function_exists("imagecreatetruecolor")) + if(function_exists("imagecreatetruecolor")&&@imagecreatetruecolor(1,1)) { $map=$map."\n\"$host_\""; } @@ -271,7 +271,7 @@ show_table2_h_delimiter(); echo "