PHP Scale image and then create image of specific size
- by Ronny vdb
The result I am trying to achieve is that the user can upload an image of any size, and the server side script will convert it to an image that has the dimension 1024x512.
To save the aspect ratio of the image I first scale the image down by either the width or height to match the wanted dimensions.
to do this I am using imagecopyresampled():
…