2

I'd like users to be able to crop their user pictures immediately. That means:

After selecting the image file, it gets uploaded immediately (as opposed to waiting for the user to submit the entire profile edit form) and some kind of overlay, div, etc. appears that allows the cropping to be done.

As far as I can tell, a module does not exist that provides this functionality. If I'm wrong, please direct me to the module I'm looking for. If I'm right that it doesn't exist, what tips would you offer? Is there a module that will help get me part of the way, i.e. immediate upload, and then I can implement the rest (like just the cropping)?

2

The best solution I found is to use the Imagefield Crop module. This does NOT work on profile pictures, so simply disable user pictures and then add an image field to the user account fields. It will work with that.

1

Assuming Drupal 7 here...

Not sure about a module that does this, but as a starting point I would add a submit handler for the image upload. You could also try one of the hooks that the file module fires.

Inside that, you can call theme('image_style') which will give you the URL of the image w/ the selected style. You can then call image_style_create_derivative, which does what it says.

Check out image_style_deliver, which is the menu callback when a browser requests a styled image, for inspiration.

1

The Image JavaScript Crop module should get you a good part of the way there.

It has support for the user profile picture built in so in fact it might be exactly what you're looking for.

Not the answer you're looking for? Browse other questions tagged or ask your own question.