[Piwik-svn] r213 - trunk/libs/sparkline/lib

svnmaster at piwik.org svnmaster at piwik.org
Sun Jan 20 08:10:53 CET 2008


Author: matt
Date: 2008-01-20 08:10:52 +0100 (Sun, 20 Jan 2008)
New Revision: 213

Modified:
   trunk/libs/sparkline/lib/Sparkline.php
Log:


Modified: trunk/libs/sparkline/lib/Sparkline.php
===================================================================
--- trunk/libs/sparkline/lib/Sparkline.php	2008-01-20 07:09:11 UTC (rev 212)
+++ trunk/libs/sparkline/lib/Sparkline.php	2008-01-20 07:10:52 UTC (rev 213)
@@ -192,10 +192,19 @@
   //
   function CreateImageHandle($x, $y) {
     $this->Debug("Sparkline :: CreateImageHandle($x, $y)", DEBUG_CALLS);
-
-    $handle = imagecreatetruecolor($x, $y);
+	if(function_exists('imagecreatetruecolor'))
+	{
+	    $handle = imagecreatetruecolor($x, $y);
+	}
+	elseif(function_exists('imagecreate'))
+	{		
+      $handle = imagecreate($x, $y);
+	}
+	else
+	{
+		echo "You need at least imagecreate()";exit;
+	}
     if (!is_resource($handle)) {
-      $handle = imagecreate($x, $y);
       $this->Debug('imagecreatetruecolor unavailable', DEBUG_WARNING);
     }
 



More information about the Piwik-svn mailing list