(☞ຈل͜ຈ)☞ Главная  Статьи  Загрузчик Домой

Ok!
Ok!
75
$widthPreview = 200;
$heightPreview = 200;

if ($arResult["DETAIL_PICTURE"]) {
    $file = CFile::ResizeImageGet($arResult["DETAIL_PICTURE"], array('width'=> $widthPreview, 'height'=> $heightPreview), BX_RESIZE_IMAGE_EXACT, true);
    $arResult["PREVIEW_PICTURE"]["SRC"] = $file["src"];
    $arResult["PREVIEW_PICTURE"]["WIDTH"] = $file["width"];
    $arResult["PREVIEW_PICTURE"]["HEIGHT"] = $file["height"];
} elseif($arResult["PREVIEW_PICTURE"]) {
    $file = CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"], array('width'=> $widthPreview, 'height'=> $heightPreview), BX_RESIZE_IMAGE_EXACT, true);
    $arResult["PREVIEW_PICTURE"]["SRC"] = $file["src"];
    $arResult["PREVIEW_PICTURE"]["WIDTH"] = $file["width"];
    $arResult["PREVIEW_PICTURE"]["HEIGHT"] = $file["height"];
}
resizeImageGet, resize, bitrix250result_modifier для кеширования и ресайза картинок
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21