Answer the question
In order to leave comments, you need to log in
How to make a square image preview in PHP?
You need to do like here with the authors, for example, I upload an image of 500x250, and I get 256x256 (or any other size, for example, 64x64)
Original image
And this is what we get
UPD.
If the height of the image is greater than the width, the length of the square is equal to the width, and if the width is greater, the length is equal to the height, and then the whole thing is increased or reduced to the desired size.
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