Skip to content

Instantly share code, notes, and snippets.

View thanhvuong's full-sized avatar
🏠
Working from home

Thanh Vuong thanhvuong

🏠
Working from home
View GitHub Profile
@thanhvuong
thanhvuong / graphics_magick_center_image_on_canvas.js
Created March 9, 2017 06:46 — forked from edwardhotchkiss/graphics_magick_center_image_on_canvas.js
Use GM Module (Graphics Magick) for Node.js to center an image on a white background canvas
var gm = require('gm');
var canvasWidth = 248;
var canvasHeight = 389;
gm(__dirname + '/original.jpg').size(function(error, size) {
if (error) {
console.error(error);