Open turchinc opened 10 years ago
Would it be possible for you to set up a jsfiddle or similar I can execute?
By the way, you can implement simple cropping like this without Caman unless you wish to store the results. You simply need to set up a container (overflow: hidden, fixed width, height according to your crop) and then make copy of the image its child. Then you need to offset the image within that cropping container.
You can see the technique in action at a related blog post of mine.
This should work to illustrate the issue: http://jsfiddle.net/k6fjg/3/
Hmm. Maybe your source and target are in the wrong order? In the documentation target comes first.
You could try to reduce the problem further and see if you can get that syntax to work in any case. Start with image and then replace that with a canvas.
I stumbled onto caman last week and am trying to use it achieve client side cropping of images: I have a source image and a canvas for crop previews on a page. The source image is loaded from the server and the jcrop allows the user to draw a crop area on the source. When the crop is selected, I want to use caman to then render the crop onto a canvas on the page (leaving the source unaltered). If the user wants to keep it, okay, otherwise they can do a new crop from the source (it remains unchanged). Everything "seems" to work (I get no errors, the crop coordinates are correct and caman logs the following):
but the crop canvas remains blank. The sample page, reduced to it's most basic elements looks like this:
Can you please advise as to what I am doing wrong? Thanks!