Answer the question
In order to leave comments, you need to log in
Bitrix: What am I doing wrong with CFile::ResizeImageGet?
Recently, previews have disappeared. I can't figure out why.
Images are loaded via api from outside.
At random came to this line:
CFile::ResizeImageGet($array["DETAIL_PICTURE"], array('width'=>100, 'height'=>100), BX_RESIZE_IMAGE_PROPORTIONAL, true);
Answer the question
In order to leave comments, you need to log in
in short, Bitrix API offers
<?if($arResult["DETAIL_PICTURE"]) {
$PICTURE = CFile::ResizeImageGet($arResult["DETAIL_PICTURE"], Array('width'=>340, 'height'=>340), BX_RESIZE_IMAGE_PROPORTIONAL, true);?>
<div class="Image"><img src="<?=$PICTURE["src"]?>" alt="<?=$arResult["NAME"]?>" title="<?=$arResult["NAME"]?>" /></div>
<?}?>
if (!is_array($file) || !array_key_exists("FILE_NAME", $file) || strlen($file["FILE_NAME"]) <= 0)
return false;
$arFile["name"] = $io->GetLogicalName(bx_basename($path));
$arFile["size"] = filesize($path);
$arFile["tmp_name"] = $path;
$arFile["type"] = $mimetype;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question