lib/modes.js
function _imageOptim(rawFile, algorithms, reduceFunc, initVal) {
    return Q.all([rawFile.loadSize(), rawFile.loadType()])
        .then(function () {
            return algorithms[rawFile.type].reduce(reduceFunc, initVal);
        })
        .fail(function (err) {
            throw err;
        });
}
function _imageOptim(rawFile, algorithms, reduceFunc, initVal) {
    return Q.all([rawFile.loadSize(), rawFile.loadType()])
        .then(function () {
            return algorithms[rawFile.type].reduce(reduceFunc, initVal);
        })
        .fail(function (err) {
            throw err;
        });
}
function _imageOptim ( rawFile , algorithms , reduceFunc , initVal ) { return Q . all ( [ rawFile . loadSize ( ) , rawFile . loadType ( ) ] ) . then ( function ( ) { return algorithms [ rawFile . type ] . reduce ( reduceFunc , initVal ) ; } ) . fail ( function ( err ) { throw err ; } ) ; }
Processes the file in the specifies mode
@param {File} rawFile
@param {Function[]} algorithms
@param {reduceCallback} reduceFunc
@param {Promise * File|Boolean} initVal
@returns {Promise * File|Boolean}
Processes the file in the specifies mode