ts)) { header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $this->ts) . ' GMT'); } pl_cached_dynamic_content_headers($this->mime); if (empty($this->data)) { readfile($this->file); } else { echo $this->data; } exit; } public function path() { if (empty($this->data)) { return $this->file; } else { $name = md5($this->data); $GLOBALS['img' . $name] = $this->data; return 'var://img' . $name; } } public function width() { return $this->x; } public function height() { return $this->y; } public function mimeType() { return $this->mime; } public static function fromData($data, $mime, $x = null, $y = null, $ts = null) { $image = new PlImage(); $image->data = $data; $image->mime = $mime; $image->x = $x; $image->y = $y; $image->ts = $ts; return $image; } public static function fromFile($path, $mime, $x = null, $y = null, $ts = null) { $image = new PlImage(); $image->file = $path; $image->mime = $mime; $image->x = $x; $image->y = $y; $image->ts = $ts; return $image; } } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>