Answer the question
In order to leave comments, you need to log in
Is there a resize photo in Bitrix api for height and width?
Good afternoon
Tell me if there is an api for Bitrix resize a photo for width and height while maintaining proportions.
let's say people load 1170x700, then resize according to my parameters 720x520 while maintaining proportions.
The only important nuance is that my proportions must be forcibly built 720x520 and not less than the height.
Answer the question
In order to leave comments, you need to log in
First option
Do CFile::ResizeImageGet BX_RESIZE_IMAGE_PROPORTIONAL_ALT and set the width to large, like 10000, and the height = 520, then the height limit of 520 will always apply
$imageId = 1;
$arImage = CFile::ResizeImageGet($imageId, array("width" => 10000, "height" => 520), BX_RESIZE_IMAGE_PROPORTIONAL_ALT, false);
.owl-item>div>div>a{
position: relative;
padding-top: 80%;
display: block;}
.owl-item>div>div>a>img{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
object-fit: cover}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question