Please tell us who knows how to stretch the image proportionally so that it is not flattened.
increase / decrease one of the dimensions, either height or width, and the other does not specify at all.
If the script, then here we have the original image and we know its size. We divide the height by the length or vice versa. We got a ratio factor. Then we change one of the sides and use it and the coefficient for the other side. Example:
233x411 К:0.57 (высота к длине, т.е. высота=0.57*длина) Изменяем длину = 500, то длина будет = 0.57 **500 = 285