Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking into building an image uploading interface within Visualforce. I really want it to work similar to how the interface works when you upload your Chatter profile picture. The user should be able to upload an image, then crop the image to a thumbnail that has a locked aspect ratio. The file should then be resized to 120x120. Once the image is cropped, I need to send this to the server and save as an attachment. I only need to save the cropped version.

I know that there is no server-side Apex support for image manipulation. I'm looking at JS and image resize/cropping services to see if there is a decent solution.

Has anyone done something like this? Any recommended libraries and/or services to use?

P.S. If you want to see Apex support for image manipulation you should vote up this idea.

share|improve this question
up vote 1 down vote accepted

jcrop appears to do (link to google because github is down at the time of writing) what you're looking for, I doubt image manipulation would every be directly supported in Apex as it's not a feature likely to get a whole lot of use, but maybe it will happen!

I would definitely do this in javascript anyway as it would minimise the amount of back-and-forth with relatively large chunks of data if using the controller for updates which would be very slow relative to processing locally on the user's machine. Also I forget how big the heap is these days but it'd be easy to blow out with large image sizes since all manipulations would happen on decompressed image data, and bitmap data gets big fast.

share|improve this answer
Does jcrop support doing this on the client? All of the demos (which used php) I saw included some server-side processing. – Ryan Guest Dec 23 '12 at 6:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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