Ip\Internal\Repository\BrowserModel::createPreview PHP Method

createPreview() private method

Get preview file for file browser
private createPreview ( string $file ) : string
$file string
return string
    private function createPreview($file)
    {
        $pathInfo = pathinfo($file);
        $ext = strtolower(isset($pathInfo['extension']) ? $pathInfo['extension'] : '');
        $baseName = $pathInfo['basename'];
        if (in_array($ext, $this->supportedImageExtensions)) {
            $transform = array('type' => 'fit', 'width' => 140, 'height' => 140, 'forced' => true);
            $reflection = ipReflection($file, $transform, $baseName);
            if ($reflection) {
                return ipFileUrl($reflection);
            }
        }
        return ipFileUrl('Ip/Internal/Repository/assets/icons/general.png');
    }