If I have a image frame as border image and another actual image around which first image should go nicely how do I do that in fabric js.
I tried-
fabric.Image.fromURL('img1', function(img){
img1 = img;
fabric.Image.fromURL('img2', function(img){
img1.scaleToWidth(canvas.getWidth());
img2 = img;
img2.scaleToHeight(img1.height*1);
img2.scaleToHeight(img1.width*0.999);
img2.left = 11;
img2.top = 10;
img2.globalCompositeOperation = 'source-atop';
canvas.add(img1);
canvas.add(img2);
});
});