node.js How to create thumbnail from image?

image-processing, javascript, node-imagemagick, node.js

Solution

I have solved it with this code:

imageMagick(picture.path)
    .resize('250', '180', '^')
    .gravity('center')
    .extent(250, 180)
    .write(picture.thumb_path, function (error) {
       if(error) console.log(error);
});

Problem

I'm using gm module.This is my code: ``` gm(picture.path).thumb('250', '180', picture.thumb_path, 100, function (error) { if(error) console.log(error); }); ``` But result size sometimes is 249x180. I need 250x180

Original source