public function relativePath($url) {
        $path = $this->toPath($url);
        if (!preg_match('#'.$this->config['path'].'#', $path, $matches)) {
            throw new Exception("$url doesn't match `{$this->config['path']}`");
        }
        return $matches[1];
    }
public function relativePath($url) {
        $path = $this->toPath($url);
        if (!preg_match('#'.$this->config['path'].'#', $path, $matches)) {
            throw new Exception("$url doesn't match `{$this->config['path']}`");
        }
        return $matches[1];
    }
public function relativePath ( $ url ) { $ path = $ this -> toPath ( $ url ) ; if ( ! preg_match ( '#' . $ this -> config [ 'path' ] . '#' , $ path , $ matches ) ) { throw new Exception ( "$url doesn't match `{$this->config['path']}`" ) ; } return $ matches [ 1 ] ; }
Take a URL or path to an image and get the path relative to the src and
crops dirs by using the `path` config regex

@param string $url url or path
@return string
Take a URL or path to an image and get the path relative to the src and crops dirs by using the path config regex