- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/classes/general/file.php
- Класс: CFile
- Вызов: CFile::ScaleImage
static function ScaleImage($sourceImageWidth, $sourceImageHeight, $arSize, $resizeType, &$bNeedCreatePicture, &$arSourceSize, &$arDestinationSize)
{
$source = new Rectangle($sourceImageWidth, $sourceImageHeight);
$destination = new Rectangle($arSize["width"], $arSize["height"]);
$bNeedCreatePicture = $source->resize($destination, $resizeType);
$arSourceSize = [
"x" => $source->getX(),
"y" => $source->getY(),
"width" => $source->getWidth(),
"height" => $source->getHeight(),
];
$arDestinationSize = [
"x" => $destination->getX(),
"y" => $destination->getY(),
"width" => $destination->getWidth(),
"height" => $destination->getHeight(),
];
}