PHP uploading images in the correct dimensions
<p>I know this question is very common but the main point in my question is that i want to know how facebook or some other websites upload their pictures in the correct size. for example. if we upload a picture of the dimension : width : 1000px , height : 20px. then facebook updates the status updates with that pic but makes the image size small in the correct ratio. its jus scales down the picture but we can know that the image is very widthy (my own word for very high width :P) where as long heighty pictures are also posted in the correct proportion.</p>

<p><img src="http://i.stack.imgur.com/YEePN.png" alt="PIC NUMBER 1"></p>

<p><img src="http://i.stack.imgur.com/2n8K6.png" alt="PIC NUMBER 2"></p>

<p>I have included the image examples above. how does facebook calculate the size n ratio of the pics and echo out the pic by keeping the right dimensions but scaling it down at the same time. </p>
