Changeset 2774
- Timestamp:
- 09/22/10 21:43:05 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
alternc-philesight/trunk/var/alternc/bureau/class/philesight.php
r2773 r2774 4 4 ############################################################################## 5 5 6 $path_db = "/var/alternc/philesight/server.db";7 6 $img_size = 800; 8 7 $img_rings = 4; … … 23 22 class Philesight { 24 23 25 public $philesight_path = '/usr/lib/alternc/philesight'; 24 private $philesight_path = '/usr/lib/alternc/philesight'; 25 private $path_db = '/var/alternc/philesight/server.db'; 26 26 27 27 public function initialize() { 28 29 $fname = $this->run("--db /var/alternc/philesight/server.db --path / --draw /tmp/page.png"); 30 $file = '/tmp/page.png'; 31 $image = imagecreatefrompng($file); 32 imagealphablending($image, false); 33 imagesavealpha($image, true); 34 35 // start buffering 36 ob_start(); 37 imagepng($image); 38 $content = ob_get_contents(); 39 ob_end_clean(); 40 echo "<img src='data:image/png;base64,".base64_encode($content)."' />"; 41 imagedestroy($image); 28 echo $this->do_image('/'); 42 29 } 43 30 … … 83 70 return $stdout; 84 71 } 72 73 protected function do_image($path = "/") { 74 75 $fname = $this->run("--db ".$this->path_db." --path ".$path." --draw /tmp/page.png"); 76 $file = '/tmp/page.png'; 77 $image = imagecreatefrompng($file); 78 imagealphablending($image, false); 79 imagesavealpha($image, true); 80 81 // start buffering 82 ob_start(); 83 imagepng($image); 84 $content = ob_get_contents(); 85 ob_end_clean(); 86 imagedestroy($image); 87 return "<img src='data:image/png;base64,".base64_encode($content)."' />"; 88 } 85 89 } 86 90 ?>
Note: See TracChangeset
for help on using the changeset viewer.
