Last active
November 4, 2016 13:43
-
-
Save ildarkhasanshin/f5d67a6335771222ce6a8953b8d95a19 to your computer and use it in GitHub Desktop.
bitrix | resize preview-picture via result_modifier.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { | |
die(); | |
} | |
foreach ($arResult["ITEMS"] as $key => $arElement) { | |
if (!empty($arElement["PREVIEW_PICTURE"]["SRC"])) { | |
$arFileTmp = CFile::ResizeImageGet( | |
$arElement["PREVIEW_PICTURE"], | |
array("width" => 100, "height" => 100), | |
BX_RESIZE_IMAGE_EXACT, | |
true, | |
false, | |
false, | |
99 | |
); | |
$arResult["ITEMS"][$key]["PREVIEW_PICTURE"] = array( | |
"SRC" => $arFileTmp["src"], | |
"WIDTH" => $arFileTmp["width"], | |
"HEIGHT" => $arFileTmp["height"], | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment