I'm trying to resize and crop an image in node.js
I've been using graphicsmagick:
code is as follows:
gm(path)
.resize(width, height)
.crop(50, 50, left, top)
.write(path, function(err){})
It's very simple. I have no idea how to use canvas, what's the equivalent in canvas?
Thanks.
For some reason, this signature is never used in examples:
context.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh);
Crop using sx, sy, sw, sh
Resize using dw, dh