title: Resize & compress uploaded image in JavaScript
body: <p>I'm building a website which will have a lot of user uploaded images.
  I would like to resize and compress (preferably change their format to .jpg) these images client side, before uploading them to a server.</p>
  
  <p>How would one go about doing this?
  I have found a few solutions, but none that really work on uploaded files.
  The latest I've tried is the <a href="https://github.com/viliusle/Hermite-resize" rel="nofollow noreferrer">Hermite-resize</a> script. Should be as simple as:</p>
  
  <pre><code>// Get images from input field
  var uploadedImages = event.currentTarget.files;
  
  
  var HERMITE = new Hermite_class(); 
  HERMITE.resize_image(uploadedImages[1], 300, 100);
  </code></pre>
  
  <p>But apparently the <code>uploadedImages</code> return as <code>null</code>. While I'm also using them elsewhere, so I'm 100% positive they are not <code>null</code>
  Does anyone know how to use this script effectively with uploaded files?
  Or is there, perhaps, a better solution to resize/compress images on the client side?</p>
  
  <p>Thanks in advance!</p>