Created
August 24, 2017 09:09
-
-
Save abinavseelan/481e5d1459b8ea41d7787d5e2911a603 to your computer and use it in GitHub Desktop.
Medium - Image Manipulation using NodeJS - Cropping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gm = require('gm'); | |
const width = 300; | |
const height = 400; | |
gm('/path/to/image/file') | |
.crop(width, height) | |
.write('/path/to/output', (err) => { | |
if (err) { | |
console.log(err); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment