Answer the question
In order to leave comments, you need to log in
Resizing an image with php?
Hello, this may seem like a stupid question, but since I'm still a beginner, I don't understand what I'm doing wrong, so I'm asking for help.
The essence of the problem is this: For example, the image exceeds the dimensions and I need to bring it to the maximum allowable dimensions, which are written in the $width and $height variables .
If the image is oversized, but it is horizontal, everything works as intended. If the image is vertical, then it is not reduced to the maximum allowed value, which is stored in the variable height . What am I doing wrong? Maybe there is some more elegant way to bring the image to the maximum allowed dimensions?
PS I need php to do this, and js
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question