Пример #1
0
 public function encode($source, array $params = [])
 {
     list($source, $params) = $this->prepareData($source, $params);
     $server = ImageServerFactory::make($this->config);
     $image = $server->getEncodedImage($source, $params);
     return $image ?: '';
 }
Пример #2
0
 public function index()
 {
     $path = $this->request->path();
     $params = $this->request->query->all();
     if ($this->validateHttpSignature($path, $params) === false) {
         return $this->notFoundResponse();
     }
     $server = ImageServerFactory::make($this->config);
     $image = $server->outputImage($path, $params);
     if (!$image) {
         return $this->notFoundResponse();
     }
     return $image;
 }