src/Middleware/GlideMiddleware.php
protected function _passThrough($request, $response, $server)
    {
        $source = $server->getSource();
        $path = $server->getSourcePath($this->_path);

        $resource = $source->readStream($path);
        if ($resource === false) {
            throw new ResponseException();
        }
        $stream = new Stream($resource);

        $contentType = $source->getMimetype($path);
        $contentLength = $source->getSize($path);

        return (new Response())->withBody($stream)
            ->withHeader('Content-Type', $contentType)
            ->withHeader('Content-Length', $contentLength);
    }
protected function _passThrough($request, $response, $server)
    {
        $source = $server->getSource();
        $path = $server->getSourcePath($this->_path);

        $resource = $source->readStream($path);
        if ($resource === false) {
            throw new ResponseException();
        }
        $stream = new Stream($resource);

        $contentType = $source->getMimetype($path);
        $contentLength = $source->getSize($path);

        return (new Response())->withBody($stream)
            ->withHeader('Content-Type', $contentType)
            ->withHeader('Content-Length', $contentLength);
    }
protected function _passThrough ( $ request , $ response , $ server ) { $ source = $ server -> getSource ( ) ; $ path = $ server -> getSourcePath ( $ this -> _path ) ; $ resource = $ source -> readStream ( $ path ) ; if ( $ resource === false ) { throw new ResponseException ( ) ; } $ stream = new Stream ( $ resource ) ; $ contentType = $ source -> getMimetype ( $ path ) ; $ contentLength = $ source -> getSize ( $ path ) ; return ( new Response ( ) ) -> withBody ( $ stream ) -> withHeader ( 'Content-Type' , $ contentType ) -> withHeader ( 'Content-Length' , $ contentLength ) ; }
Generate response using original image.

@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 Response instance
Generate response using original image .