title: FineUploader scale thumbnails by one dimension (i.e. maxHeight or maxWidth rather than maxSize)
body: <p>The library takes a <code>maxSize</code> parameter for scaling, which applies to the longest of both dimensions. It seems that the work-around solution to scale by one dimension would be to manually run <code>scaleImage()</code> in an <code>onSubmitted</code> callback by calculating what the <code>maxSize</code> should be based on the original image size to get a result with the desired height or width, but this has its own hurdles:</p>
  
  <p>It makes sense that using <code>addFiles()</code> inside of a <code>onSubmitted</code> callback would trigger another <code>onSubmitted</code> event; but if I use <code>addFiles()</code> to add the thumbnail, the thumbnail shows up in the UI list, and this triggers another <code>onSubmitted</code> causing another thumbnail to be generated, which keeps going in a loop.</p>
  
  <p>I need to generate a thumbnail retrained by (a maxHeight of 240 pixels and a maxWidth of 320 pixels) and upload the thumbnail to a separate S3 bucket when <code>uploadStoredFiles()</code> is called, without triggering another <code>onSubmitted</code> event and without showing the thumbnail as a "duplicate" entry in the UI file list. What is the best way to do this in Fine-Uploader?</p>
  
  <hr>
  
  <p>Some sample code:</p>
  
  <pre><code>          function makeThumbnail() {
              // FIXME to avoid duplicate, put this in the compression success
              var thumbnailPromise = uploader.scaleImage(id, {
                maxSize: 123,
                quality: 45,
                customResizer: !qq.ios() &amp;&amp; function (resizeInfo) {
                  return new Promise(function (resolve, reject) {
                    pica.resizeCanvas(resizeInfo.sourceCanvas, resizeInfo.targetCanvas, {}, resolve)
                  });
                }
              });
              thumbnailPromise.then(
                  function (blob) {
                    console.log(URL.createObjectURL(blob));
                    uploader.addFiles(blob);
                  },
                  function (err) {
                  }
              );
            }
  </code></pre>