public function thumb() { //配置参数 $imgSrc = IFilter::act(IReq::get('img'), 'filename'); $width = IFilter::act(IReq::get('w'), 'int'); $height = IFilter::act(IReq::get('h'), 'int'); if ($imgSrc && $width && $height && isset($_SERVER['HTTP_USER_AGENT'])) { $imgSrc = IFile::dirExplodeDecode($imgSrc); if (is_file($imgSrc)) { $thumbSrc = Thumb::get($imgSrc, $width, $height); $fileExt = pathinfo($thumbSrc, PATHINFO_EXTENSION); $mtime = filemtime($thumbSrc); $gmdate_mod = gmdate('D, d M Y H:i:s', $mtime) . ' GMT'; header('Last-Modified: ' . $gmdate_mod); header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 60 * 60 * 24 * 30) . ' GMT'); header('Content-type: image/' . $fileExt); header('Content-Length: ' . filesize($thumbSrc)); readfile($thumbSrc); } } return ''; }