2

Is there any way to check for a callback for the CamanJS library once the image is loaded so I can call the caman functions once the caman object is ready?

ie

var tempCanvas = document.createElement('canvas');
var c = Caman(tempCanvas, 'path/to/image.jpg');
if (c.isLoaded) {
   c.reset();
   c.resize({width: new_w, height: new_h});
   c.render();
}

I need the callback to be external because the crop and resize functions I want to apply are using variables that would not be visible inside the scope of an anonymous function callback if called in the Caman initializer.

0 Answers0