What would be the recommended way for doing server side image resizing/cropping?

I have also been experimenting with doing this stuff client side.
If I get that to work then I only need to do server side image verification and sanitation. Any advice?