Let me explain with an example.
Lets say I have an Image of size
960px X 668px
I have a div which holds this image. The div size is
154px X 75px
This div can have any variable size.
If we see that the aspect ratio of image and the aspect ratio of the div
that holds image are different.
All i need to do is Resize and Crop the Image using PHP in such a way that it takes maximum possible height and width of the original size and also maintain the aspect ratio of the div that holds this image. I just need a logic to calculate a percentage that by how much DIV width and height should be multiplied so that the resulting size is closer to the image size but doesnot exceed the image size and also the aspect Ratio will be same as that of DIV but not of image.
Thanks Sharmila