View Full Version : image cropping through javascript

09-01-2011, 07:30 AM
I need to do image cropping through javascript(without jquery)
my requirement is just to get the coordinates through some callback function whenever user crop the image and click an ok button
please help me with some javascript code here

Philip M
09-01-2011, 08:52 AM

This is not possible with vanilla JavaScript.

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

09-01-2011, 11:23 AM
The question is: Do you really need to "physically" crop the image or do you just want to show a cropped part of the image without actually cropping it?

For the latter you can use a DIV with overflow:hidden and width/height of the visible cropped section and then position your image inside this DIV. I think the easiest way would be using a CSS background-image with background positioning.

rnd me
09-02-2011, 01:16 AM
use the canvas tag's api, you don't need a server anymore...