|
|
Ok!
|
|
|
Ok!
|
|---|---|---|---|---|
| 79 | <?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
$widthPreview = 300;
$heightPreview = 200;
$widthPreviewBig = 300*2;
$heightPreviewBig = 200*2;
foreach($arResult['ITEMS'] as $i => $arItem) {
$file = CFile::ResizeImageGet($arItem['FIELDS']["DETAIL_PICTURE"]['ID'], array('width' => $widthPreviewBig, 'height' => $heightPreviewBig), BX_RESIZE_IMAGE_EXACT, true);
$arResult['ITEMS'][$i]["FIELDS"]["DETAIL_PICTURE"]["SRC"] = $file["src"];
$arResult['ITEMS'][$i]["FIELDS"]["DETAIL_PICTURE"]["WIDTH"] = $file["width"];
$arResult['ITEMS'][$i]["FIELDS"]["DETAIL_PICTURE"]["HEIGHT"] = $file["height"];
$file = CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"]['ID'], array('width' => $widthPreview, 'height' => $heightPreview), BX_RESIZE_IMAGE_EXACT, true);
$arResult['ITEMS'][$i]["PREVIEW_PICTURE"]["SRC"] = $file["src"];
$arResult['ITEMS'][$i]["PREVIEW_PICTURE"]["WIDTH"] = $file["width"];
$arResult['ITEMS'][$i]["PREVIEW_PICTURE"]["HEIGHT"] = $file["height"];
} | resizeImageGet, resize, bitrix | 2300 | Ресайз |
| 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, bitrix | 250 | result_modifier для кеширования и ресайза картинок |