Profile Image and User Crop

Topics: Customizing Orchard, Writing modules
Oct 16, 2014 at 2:55 AM
Hi!

I need for my next project an ProfileImage. But it has to be in a 160x160 format and I need to allow the user to select the crop-area of the image in that ratio. So I think the best way to do this, is to create a new Module (maybe with the base of the old obsolete ImageField?) and make a new UserCropImage Field. Or is there a better idea?

Thanks for thinking ;)
Developer
Oct 16, 2014 at 7:01 AM
There is an ImageEditor feature that provides cropping of images. Maybe that suits your needs?
Oct 16, 2014 at 3:28 PM
Hi! Thanks for reply, but I need a "simpler" solution and as far as I know I can't force a user to crop in the image editor with an predefined ratio or is there a way?
Developer
Oct 18, 2014 at 2:15 AM
Define "simpler"? :)
In any case, if the default Image Editor feature is not how you want it, then yes, you will have to create a new module. You could copy what's there in the image editor feature, and I'm sure that the cropping script used there supports setting a predefined ratio.
Oct 18, 2014 at 3:52 AM
I am not sure, if i can config the ImageEditor like I want.
I need the Image for an UserProfile and I need to force the User to crop it. I am not sure if I can achieve that with default modules. I will take a look into the ImageEditor feature and I hopefully can reuse it in some way.
Oct 26, 2014 at 6:30 PM
Edited Oct 26, 2014 at 8:22 PM
Hi!
If anybody need something similar: I created a fork of ImageField with the option for cropping. It's still in an Alpha / Beta State but it seems to be working ok. I really appreciate if somebody is testing it and if there is a problem or an feature request - add them to the github tracking system.

Gallery: https://gallery.orchardproject.net/List/Modules/Orchard.Module.Rimango.ImageField/
Source: https://github.com/benschi11/Rimango.ImageField
Issue: https://github.com/benschi11/Rimango.ImageField/issues

Demo (only with custom forms for the moment): http://orchard-demos.neuhold.pro/RimangoImageField

Thanks