Speed now optimized for weak hardware like the NLSU2. Improvement is more than 50 percent.

git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@104 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinhaas
2007-10-23 19:42:09 +00:00
parent 8139f33507
commit f34719bc26
11 changed files with 304 additions and 160 deletions

View File

@@ -11,6 +11,35 @@ include "../config.php";
$datefs20=$_GET['datefs20'];
$room=$_GET['room'];
## do we really need a new graphic??
#$execorder=$tailpath.' -1 '.$file;
#exec($execorder,$tail1);
#$parts = explode(" ", $tail1[0]);
#$date=$parts[0];
$savefile=$AbsolutPath."/tmp/FS20.".$drawfs20.".log.".$datefs20.".png";
if (file_exists($savefile)) {
$im2 = @ImageCreateFromPNG($savefile);
header("Content-type: image/png");
imagePng($im2);
exit; # ;-)))
}
else #delete old pngs
{
$delfile=$AbsolutPath."/tmp/FS20.".$drawfs20.".log.*.png";
foreach (glob($delfile) as $filename) {
unlink($filename);
}
}
$im = ImageCreateTrueColor($imgmaxxfs20,$imgmaxyfs20);
$black = ImageColorAllocate($im, 0, 0, 0);
$bg1p = ImageColorAllocate($im, 110,148,183);
@@ -86,6 +115,7 @@ include "../config.php";
if ($room != '') {ImageTTFText ($im, 7, 0, 5, 26, $txtcolor, $fontttf, $txtroom.$room);};
imagePng($im,$savefile);
header("Content-type: image/png");
imagePng($im);
?>