title: Getting file width and height with File API
body: <p>I haven't used HTML5 File API much, so am pretty new to it.</p>
  
  <p>I am trying to get the width and height of a file from the file upload field '#submission-file' field into two variables.</p>
  
  <p>Here is the code I have:</p>
  
  <pre><code>    var fileWidth = 0;
      var fileHeight = 0;
      var url = window.URL || window.webkitURL;
      var fileField = $('#submission-file')[0].files[0];
      var image = new Image();
      image.onload = function() {
          fileWidth = $('#submission-file').width;
          fileHeight = $('#submission-file').height;
      };
      image.src = url.createObjectURL(fileField); 
  </code></pre>
  
  <p>Can anyone show me what I am doing wrong?</p>