芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/fmd/vendor/intervention/image/src/Intervention/Image/AbstractDriver.php
decoder->init($data); } /** * Encodes given image * * @param Image $image * @param string $format * @param integer $quality * @return \Intervention\Image\Image */ public function encode($image, $format, $quality) { return $this->encoder->process($image, $format, $quality); } /** * Executes named command on given image * * @param Image $image * @param string $name * @param array $arguments * @return \Intervention\Image\Commands\AbstractCommand */ public function executeCommand($image, $name, $arguments) { $commandName = $this->getCommandClassName($name); $command = new $commandName($arguments); $command->execute($image); return $command; } /** * Returns classname of given command name * * @param string $name * @return string */ private function getCommandClassName($name) { $drivername = $this->getDriverName(); $classnameLocal = sprintf('\Intervention\Image\%s\Commands\%sCommand', $drivername, ucfirst($name)); $classnameGlobal = sprintf('\Intervention\Image\Commands\%sCommand', ucfirst($name)); if (class_exists($classnameLocal)) { return $classnameLocal; } elseif (class_exists($classnameGlobal)) { return $classnameGlobal; } throw new \Intervention\Image\Exception\NotSupportedException( "Command ({$name}) is not available for driver ({$drivername})." ); } /** * Returns name of current driver instance * * @return string */ public function getDriverName() { $reflect = new \ReflectionClass($this); $namespace = $reflect->getNamespaceName(); return substr(strrchr($namespace, "\\"), 1); } }