Search code examples
javascriptjqueryimagejcrop

save cropped image using JCrop


I am cropping a image using jcrop. I am showing preview of the cropped image before saving it, as shown in this demo page

Now i want to save this cropped image.

So, my question here is, will jcrop creates a new image after cropping ? So that i can directly save that new image.

Or it simply generates the co-ordinates for cropped image? so that i have to save that co-ordinates ??


Solution

  • it just uses

    margin-left: -25px;
    margin-top: -6px;
    

    so the image appear cropped inside a smaller div . so it's doesn't in fact crop it .

    in case of vertical crop it will re-size the photo as well and modify the margin-top .

    so if you in fact save the width , height and margin of the img you will get your cropped image if you apply it again .