A
A
Alexander Ivanov2017-01-26 13:19:03
1C-Bitrix
Alexander Ivanov, 2017-01-26 13:19:03

Is it possible to crop one side with resizeimageget?

The woodenness of Bitrix strikes.
Can't do it like this:

<?php;
                $renderImageG = CFile::ResizeImageGet($arUser_Photo,Array("width" => "254", "height" => "auto"), BX_RESIZE_IMAGE_PROPORTIONAL, true);
                echo '<!--img alt="'.$arUser['WORK_COMPANY'].'" src="'.$renderImageG['src'].'" /-->';
              ?>

на modx revo phpthumbon могу сдалать так

т.е. обрежет только по одной стороне а вторую определит автоматически
Как на битриксе обрезать по размеру только одной стороны?
__________________
Как вариант можно определить высоту картинки до обрезки и посчитать её в процентах.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Александр Иванов, 2017-01-26
@cimonlebedev

$arFile = CFile::GetFileArray($arUser_Photo);
                $widthF = $arFile['WIDTH'];
                $heightF = $arFile['HEIGHT'];
                $procent = 254*100/$widthF;
                $height = floor($heightF*$procent/100);
                //$itog = ;
                $renderImageG = CFile::ResizeImageGet($arUser_Photo,Array("width" => "254", "height" => $height), BX_RESIZE_IMAGE_PROPORTIONAL, true);
                echo '<img alt="'.$arUser['WORK_COMPANY'].'" src="'.$renderImageG['src'].'" />';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question