uploadfs.js
function (callback) {
        if (!self._image) {
          var paths = (process.env.PATH || '').split(delimiter);
          if (!_.find(paths, function(p) {
            if (fs.existsSync(p + '/imagecrunch')) {
              self._image = require('./lib/image/imagecrunch.js')();
              return true;
            }
            // Allow for Windows and Unix filenames for identify. Silly oversight
            // after getting delimiter right (:
            if (fs.existsSync(p + '/identify') || fs.existsSync(p + '/identify.exe')) {
              self._image = require('./lib/image/imagemagick.js')();
              return true;
            }
          })) {
            // Fall back to jimp, no need for an error
            self._image = require('./lib/image/jimp.js')();
          }
        }
        return callback(null);
      }
function (callback) {
        if (!self._image) {
          var paths = (process.env.PATH || '').split(delimiter);
          if (!_.find(paths, function(p) {
            if (fs.existsSync(p + '/imagecrunch')) {
              self._image = require('./lib/image/imagecrunch.js')();
              return true;
            }
            // Allow for Windows and Unix filenames for identify. Silly oversight
            // after getting delimiter right (:
            if (fs.existsSync(p + '/identify') || fs.existsSync(p + '/identify.exe')) {
              self._image = require('./lib/image/imagemagick.js')();
              return true;
            }
          })) {
            // Fall back to jimp, no need for an error
            self._image = require('./lib/image/jimp.js')();
          }
        }
        return callback(null);
      }
function ( callback ) { if ( ! self . _image ) { var paths = ( process . env . PATH || '' ) . split ( delimiter ) ; if ( ! _ . find ( paths , function ( p ) { if ( fs . existsSync ( p + '/imagecrunch' ) ) { self . _image = require ( './lib/image/imagecrunch.js' ) ( ) ; return true ; } // Allow for Windows and Unix filenames for identify. Silly oversight // after getting delimiter right (: if ( fs . existsSync ( p + '/identify' ) || fs . existsSync ( p + '/identify.exe' ) ) { self . _image = require ( './lib/image/imagemagick.js' ) ( ) ; return true ; } } ) ) { // Fall back to jimp, no need for an error self . _image = require ( './lib/image/jimp.js' ) ( ) ; } } return callback ( null ) ; }
Autodetect image backend if necessary
Autodetect image backend if necessary