Answer the question
In order to leave comments, you need to log in
CFile::ResizeImageGet — Is it possible to resize images only in width with changing height based on aspect ratio?
You need to resize images for previews, but the original images have different heights.
Bitrix method CFile::ResizeImageGet - to resize images on the fly, you need to set the required height and width parameters. It is necessary to resize, only in width, while the height changes depending on the aspect ratio.
Is there any way to make images resize only in width, with height based change and aspect ratio?
Answer the question
In order to leave comments, you need to log in
It is possible to calculate the parameters in advance, but in practice, you can use BX_RESIZE_IMAGE_PROPORTIONAL and set the height to a known value.
For example Array("width"=>100, "height"=>10000) will work for all images whose ratio is not greater than 1 to 100
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question