title: Cannot read property 'setEncoding' of undefined
body: <p>I am trying to process a bunch of images using <code>imagemagick</code> and <code>node</code>. I have a folder of images, iterate through them, crop, and save crops to another folder:</p>
  
  <pre><code>var fs = require('fs')
    , im = require('imagemagick');
  
  var path = '/Users/me/Pictures';
  var rs = [[100,100],[200,200],[300,300],[400,400],[500,500],[600,600],[700,700],[800,800],[900,900],[1000,1000],[1100,1100],[1200,1200]];
  
  fs.readdir(path, function(err, items) {
      var counter = 0;
      var start = new Date().getTime();
      for (var i=0; i&lt;items.length; i++) {
          var image = items[i];
          if (image.endsWith('png') || image.endsWith('jpg')) {
              console.log('Processing ' + image);
              for (var r=0; r&lt;rs.length; r++) {
                  counter++;
                  console.log(counter);
                  im.crop({
                      srcPath: path + '/' + image,
                      dstPath: '/Users/me/Pictures/rends/' + c + image + rs[r][0] + 'x' + rs[r][1] + '.jpg',
                      width: rs[r][0],
                      height: rs[r][1],
                      quality: 1
                  }, function(err, stdout, stderr){
                      if (err) console.log('error:' + err);
                  });
                  }
              }
      }
      console.log(counter + ' images processed in ' + (new Date().getTime() - start) + 'milliseconds.');
  });
  </code></pre>
  
  <p>Now, the problem is, it works initially and crops ~540 images (a couple more or less) then fails with following error:</p>
  
  <pre><code>/Users/me/my_stuff/node_modules/imagemagick/imagemagick.js:76
    child.stdout.setEncoding(options.encoding);
                ^
  
  TypeError: Cannot read property 'setEncoding' of undefined
      at exec2 (/Users/me/my_stuff/node_modules/imagemagick/imagemagick.js:76:15)
      at Object.exports.identify (/Users/me/my_stuff/node_modules/imagemagick/imagemagick.js:149:14)
      at Object.exports.crop (/Users/me/my_stuff/node_modules/imagemagick/imagemagick.js:292:11)
      at /Users/me/my_stuff/node/im.js:18:8
      at FSReqWrap.oncomplete (fs.js:117:15)
  </code></pre>
  
  <p>P.S. I have tried <code>graphicsmagick</code> and it fails in a pretty similar fashion as well.</p>
  
  <p>Any help is much appreciated.</p>