I have to upload a image which is height=311 and width=238. Its not a proportional size. when i upload a image on that size, image will bad. If i got a php function which upload a image of that size which is height=311 and width=238 but original image is inner of that image and must be proportional.

The outer blank image must be of-white .

I am try to built but failed.