simple image crop snippet.
make sure the directory where the cropped image is saved is writeable.

download options for image editing / crop image

you can download the source as PHP file,

open the file as plain text in a new window or

get the code in a textarea to copy it.