Resize image after uploadin to site

i have an upload your image feature but wish to reduce (no distortion) the image.

so far it asks for the image and then stores it in a tmp folder then it checks the size (i think?) then it moves it to the new location with a new name at present a number

1.jpg
2.jpg

i wish to have between the finish uploading to temp folder and move to new location a part to reduce the size of the image with out distorting the image, if it is larger than let say 100x100

so if it is 200x200 then it is reduced to 100x100
and if it is 150x100 then it is reduced to approx. 100x67

if it is one or two pixels over or under the 100x100 limit it is not a problem, all i want to prevent is someone unloading an image 1000x1000 !!! as this in turn will prevent them from changing the image again as the selection boxes disapear of the screen completely.

thanks for any help the you can give me.

cheers.