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');
}