name = rawurldecode($opt['restAlias']); } } public function exec() { $info = Qs_ImageFs::getThumbnailInfo($this->name); $file = $width = $height = $force = $method = null; extract($info); if ($width || $height) { $name = Qs_ImageFs::resize( $file, [ 'width' => $width, 'height' => $height, 'force' => $force, 'method' => $method, 'sizeCheck' => true, ] ); if (false !== $name) { $type = Qs_FileFs::getMimeType($name); if (!empty($type)) { header('Content-Type: ' . $type); header('Content-Length: ' . filesize($name)); if (ob_get_length()) { ob_clean(); flush(); } readfile($name); exit; } else { Qs_Http::redirect(BASE_URL . '/' . Qs_ImageFs::quotePath($name)); } } header('HTTP/1.0 404 Not Found'); exit; } else { Qs_Http::redirect(BASE_URL . '/' . Qs_ImageFs::quotePath($file)); } } }