src/Middleware/GlideMiddleware.php
protected function _getResponse($request, $response, $server)
    {
        if ((empty($this->_params) ||
            (count($this->_params) === 1 && isset($this->_params['s'])))
            && $this->getConfig('originalPassThrough')
        ) {
            try {
                $response = $this->_passThrough($request, $response, $server);
            } catch (Exception $exception) {
                return $this->_handleException($request, $response, $exception);
            }

            return $response;
        }

        /** @var \League\Glide\Responses\ResponseFactoryInterface|null */
        $responseFactory = $server->getResponseFactory();
        if ($responseFactory === null) {
            $server->setResponseFactory(new PsrResponseFactory());
        }

        try {
            $response = $server->getImageResponse($this->_path, $this->_params);
        } catch (Exception $exception) {
            return $this->_handleException($request, $response, $exception);
        }

        return $response;
    }
protected function _getResponse($request, $response, $server)
    {
        if ((empty($this->_params) ||
            (count($this->_params) === 1 && isset($this->_params['s'])))
            && $this->getConfig('originalPassThrough')
        ) {
            try {
                $response = $this->_passThrough($request, $response, $server);
            } catch (Exception $exception) {
                return $this->_handleException($request, $response, $exception);
            }

            return $response;
        }

        /** @var \League\Glide\Responses\ResponseFactoryInterface|null */
        $responseFactory = $server->getResponseFactory();
        if ($responseFactory === null) {
            $server->setResponseFactory(new PsrResponseFactory());
        }

        try {
            $response = $server->getImageResponse($this->_path, $this->_params);
        } catch (Exception $exception) {
            return $this->_handleException($request, $response, $exception);
        }

        return $response;
    }
protected function _getResponse ( $ request , $ response , $ server ) { if ( ( empty ( $ this -> _params ) || ( count ( $ this -> _params ) === 1 && isset ( $ this -> _params [ 's' ] ) ) ) && $ this -> getConfig ( 'originalPassThrough' ) ) { try { $ response = $ this -> _passThrough ( $ request , $ response , $ server ) ; } catch ( Exception $ exception ) { return $ this -> _handleException ( $ request , $ response , $ exception ) ; } return $ response ; } /** @var \League\Glide\Responses\ResponseFactoryInterface|null */ $ responseFactory = $ server -> getResponseFactory ( ) ; if ( $ responseFactory === null ) { $ server -> setResponseFactory ( new PsrResponseFactory ( ) ) ; } try { $ response = $ server -> getImageResponse ( $ this -> _path , $ this -> _params ) ; } catch ( Exception $ exception ) { return $ this -> _handleException ( $ request , $ response , $ exception ) ; } return $ response ; }
Get response instance which contains image to render.

@param \Psr\Http\Message\ServerRequestInterface $request The request.
@param \Psr\Http\Message\ResponseInterface $response The response.
@param \League\Glide\Server $server Glide server.

@return \Psr\Http\Message\ResponseInterface|null Response instance on success else null
Get response instance which contains image to render .