- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/classes/general/file.php
- Класс: CFile
- Вызов: CFile::GetImageSize
static function GetImageSize($path, $bPhysicalName = false, $flashEnabled = false)
{
if(!$bPhysicalName)
{
$io = CBXVirtualIo::GetInstance();
$path = $io->GetPhysicalName($path);
}
$image = new FileImage($path);
if(($info = $image->getInfo($flashEnabled)) !== null)
{
return [
0 => $info->getWidth(),
1 => $info->getHeight(),
2 => $info->getFormat(),
3 => $info->getAttributes(),
"mime" => $info->getMime(),
];
}
return false;
}