Skip to content

Instantly share code, notes, and snippets.

@Itachi261092
Last active October 2, 2015 08:54
Show Gist options
  • Save Itachi261092/5c13484a7153119d2a58 to your computer and use it in GitHub Desktop.
Save Itachi261092/5c13484a7153119d2a58 to your computer and use it in GitHub Desktop.
[1C-Bitrix / 1С-Битрикс] Image Resize in template news.list / Ресайз картинок в шаблоне news.list
<?
foreach ($arResult["ITEMS"] as $key => $arItem){
// EXACT
$arResult["ITEMS"][$key]["RESIZE_PICTURE"] = CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"]["ID"], array('width'=>100, 'height'=>100), BX_RESIZE_IMAGE_EXACT, true);
// PROPORTIONAL
//$arResult["ITEMS"][$key]["RESIZE_PICTURE"] = CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"]["ID"], array('width'=>100, 'height'=>100), BX_RESIZE_IMAGE_PROPORTIONAL, true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment