title: PHP - Create Thumbnail & maintaining aspect ratio
body: <p>EDIT: This can be easily done in CSS, I didn't know CSS much at the time of writing this</p>
  
  <p><img src="https://i.stack.imgur.com/fCqf9.jpg" alt="enter image description here"></p>
  
  <p>I have created a thumbnail creator using PHP. The thumbnails generated should be of the same size. But the problem is the use of uploads images having different aspect ratio like landscape or portrait the thumbnail becomes ugly. So I created the picture above for clarification. Whatever be the uploaded image, it will be put into a rectangle image. So the aspect ratio doesn't change and thumbnails will be of the same size. Can anyone pls help me or tell some ideas?</p>