lib/imageProcessor.js
function(callback) {
      if (imagesPaths.length >= numberOfColumns * numberOfRows) return callback();

      var transparentImagePath = path.join(temporaryDirectoryPath, 'transparent.png');
      gm(width, height, '#00000000').write(transparentImagePath, function(error) {

        // Add as many as needed transparent images to the list of images
        var totalMissingImages = numberOfColumns * numberOfRows - imagesPaths.length;

        for (var i = 0; i < totalMissingImages; i++)
          imagesPaths.push(transparentImagePath);

        callback(error);
      });
    }
function(callback) {
      if (imagesPaths.length >= numberOfColumns * numberOfRows) return callback();

      var transparentImagePath = path.join(temporaryDirectoryPath, 'transparent.png');
      gm(width, height, '#00000000').write(transparentImagePath, function(error) {

        // Add as many as needed transparent images to the list of images
        var totalMissingImages = numberOfColumns * numberOfRows - imagesPaths.length;

        for (var i = 0; i < totalMissingImages; i++)
          imagesPaths.push(transparentImagePath);

        callback(error);
      });
    }
function ( callback ) { if ( imagesPaths . length >= numberOfColumns * numberOfRows ) return callback ( ) ; var transparentImagePath = path . join ( temporaryDirectoryPath , 'transparent.png' ) ; gm ( width , height , '#00000000' ) . write ( transparentImagePath , function ( error ) { // Add as many as needed transparent images to the list of images var totalMissingImages = numberOfColumns * numberOfRows - imagesPaths . length ; for ( var i = 0 ; i < totalMissingImages ; i ++ ) imagesPaths . push ( transparentImagePath ) ; callback ( error ) ; } ) ; }
Complete the grid defined by numberOfColumns and numberOfRows using transparent images if needed
Complete the grid defined by numberOfColumns and numberOfRows using transparent images if needed