CollectionFS get image dimensions before transformation
<p>I would like to resize image upon upload with Meteor CollectionFS. But I would like to resize based on image dimensions. For example, I want to resize image that is 1000x500 into 1024x512, but 60x100 into 64x128 - for that I need to know source dimensions.</p>

<p>I am basing my code on one provided by CollectionFS <a href="https://github.com/CollectionFS/Meteor-CollectionFS#file-manipulation" rel="nofollow">documentation</a>:</p>

<pre><code>var createThumb = function(fileObj, readStream, writeStream) {
  // Transform the image into a 10x10px thumbnail
  gm(readStream, fileObj.name()).resize('10', '10').stream().pipe(writeStream);
};
</code></pre>

<p>how do I get source dimensions here, to make my resize target dynamic? Maybe there are some graphicsmagick function?</p>