A module that you want to start looking at is Imagefield Crop. Details from project page:
When the user uploads an image it is presented inside a cropping area. A cropping box is shown inside, and the user can resize and move it. Upon clicking "preview" or "submit", the image is cropped and the result is saved instead of the original image.
Features
- Seamless, intuitive cropping, almost like using a desktop photo editing app
- All major browsers supported
- Dynamic preview - you see how your crop will look like, in real time!
- Original image is saved for recropping.
- No matter what resolution the cropping area is, the original image is used for cropping (for highest quality)
- The sizes of the cropping area, cropping box and resulting image can be controlled by the administrator
The problem with using this module however is that it only works with the imagefield module and the user picture.
If you already have a bunch of users that uploaded avatars using Drupal's core functionality then it would be best to rip the ImageField Crop module apart and see how it can be integrated into Drupal's user avatars.
If you have yet to have any users upload avatars then you can follow these steps....
- Create a user field called "Pic" and use the "Image with cropping" widget on it.
- When the user flags the image, you can redirect to the user edit page while passing the fid of the flagged image.
- After that you can use hook_form_alter to chuck in the fid, uri and fileurl from the passed fid as the '#default_value' of the newly created "Pic" field from step 1.
The annoying thing about this solution is that you will have to modify user-picture.tpl.php to use your custom created field over the default avatar picture.