var fs = require('fs'),
    config = require('../config'),
    gm = require('gm');

exports.createThumb = function(filename) {
  gm('./img/' + filename)
    .resize(config.length, config.height)
    .write('./thumb/' + filename,  function (err) {
      if (!err) return true;
    });
}

var path = require('path');
var lwip = require('lwip');
var config = require('../config');

module.exports.createThumb = function(filename) {
  lwip.open('./img/' + filename, function(err, image) {
    if (err) return console.log(err);
      image.batch()
      .resize(config.width,config.height,'cubic')
        .writeFile('./thumb/' + filename, function(err) {
           if (err) return console.log(err);
             console.log('done');
           });
     });
}

Switch to lwip