Answer the question
In order to leave comments, you need to log in
Why is ResizeImageGet not working in template.php?
Hello.
I fight everything. I don't understand at all. The code works everywhere, except for one template.
<?foreach ($arResult["ITEMS"] as $arItem) {?>
<?
$arPicture = CFile::GetFileArray($arItem["PREVIEW_PICTURE"]);
$renderImage = CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"] , Array("width" => 300, "height" => 300), BX_RESIZE_IMAGE_EXACT, false);
?>
<img src="<?=$arItem["PREVIEW_PICTURE"]["SRC"]?>" alt="<?=$arSection["PREVIEW_PICTURE"]["ALT"]?>">
<?}?>
<img src="<?=$arItem["PREVIEW_PICTURE"]["SRC"]?>" alt="<?=$arSection["PREVIEW_PICTURE"]["ALT"]?>">
var_dump ($arPicture);
$renderImage = CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"] , Array("width" => 200, "height" => 200), BX_RESIZE_IMAGE_EXACT, false);
Answer the question
In order to leave comments, you need to log in
1) You need to learn how to read the description of functions - take.ms/GjcSb
2) Pass ID
$renderImage = CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"]['ID'] , Array("width" => 200, "height" => 200), BX_RESIZE_IMAGE_EXACT, false);
You write the result to $renderImage and output it from another variable. It would be correct like this:<img src="<?=$renderImage["src"]?>" alt="">
$renderImage = CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"]["ID"] , Array("width" => 300, "height" => 300), BX_RESIZE_IMAGE_EXACT, false);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question