index.js
function (platform, splash) {
  var deferred = Q.defer();
  var srcPath = settings.SPLASH_FILE;
  var platformPath = srcPath.replace(/\.png$/, '-' + platform.name + '.png');
  if (fs.existsSync(platformPath)) {
    srcPath = platformPath;
  }
  var dstPath = platform.splashPath + splash.name;
  var dst = path.dirname(dstPath);
  if (!fs.existsSync(dst)) {
    fs.mkdirsSync(dst);
  }
  ig.crop({
    srcPath: srcPath,
    dstPath: dstPath,
    quality: 1,
    format: 'png',
    width: splash.width,
    height: splash.height
  } , function(err, stdout, stderr){
    if (err) {
      deferred.reject(err);
    } else {
      deferred.resolve();
      display.success(splash.name + ' created');
    }
  });
  return deferred.promise;
}
function (platform, splash) {
  var deferred = Q.defer();
  var srcPath = settings.SPLASH_FILE;
  var platformPath = srcPath.replace(/\.png$/, '-' + platform.name + '.png');
  if (fs.existsSync(platformPath)) {
    srcPath = platformPath;
  }
  var dstPath = platform.splashPath + splash.name;
  var dst = path.dirname(dstPath);
  if (!fs.existsSync(dst)) {
    fs.mkdirsSync(dst);
  }
  ig.crop({
    srcPath: srcPath,
    dstPath: dstPath,
    quality: 1,
    format: 'png',
    width: splash.width,
    height: splash.height
  } , function(err, stdout, stderr){
    if (err) {
      deferred.reject(err);
    } else {
      deferred.resolve();
      display.success(splash.name + ' created');
    }
  });
  return deferred.promise;
}
function ( platform , splash ) { var deferred = Q . defer ( ) ; var srcPath = settings . SPLASH_FILE ; var platformPath = srcPath . replace ( / \.png$ / , '-' + platform . name + '.png' ) ; if ( fs . existsSync ( platformPath ) ) { srcPath = platformPath ; } var dstPath = platform . splashPath + splash . name ; var dst = path . dirname ( dstPath ) ; if ( ! fs . existsSync ( dst ) ) { fs . mkdirsSync ( dst ) ; } ig . crop ( { srcPath : srcPath , dstPath : dstPath , quality : 1 , format : 'png' , width : splash . width , height : splash . height } , function ( err , stdout , stderr ) { if ( err ) { deferred . reject ( err ) ; } else { deferred . resolve ( ) ; display . success ( splash . name + ' created' ) ; } } ) ; return deferred . promise ; }
Crops and creates a new splash in the platform's folder.

@param  {Object} platform
@param  {Object} splash
@return {Promise}
Crops and creates a new splash in the platform s folder .