title: How to get the image dimension with angular-file-upload
body: <p>I'm currently using the <a href="https://github.com/danialfarid/angular-file-upload" rel="noreferrer">angular-file-upload</a> directive, and I'm pretty much using the exact codes from the demo. </p>
  
  <p>I need to add a step in there to test for the dimension of the image, and I am only currently able to do with via jQuery/javascript. </p>
  
  <p>Just wondering if there's a "angular" way to check for the dimension of the image before it's being uploaded?</p>
  
  <pre><code>$scope.uploadImage = function($files) {
      $scope.selectedFiles = [];
      $scope.progress = [];
  
      if ($scope.upload &amp;&amp; $scope.upload.length &gt; 0) {
          for (var i = 0; i &lt; $scope.upload.length; i++) {
              if ($scope.upload[i] !== null) {
                  $scope.upload[i].abort();
              }
          }
      }
      $scope.upload = [];
      $scope.uploadResult = [];
      $scope.selectedFiles = $files;
      $scope.dataUrls = [];
  
      for ( var j = 0; j &lt; $files.length; j++) {
          var $file = $files[j];
          if (/*$scope.fileReaderSupported &amp;&amp; */$file.type.indexOf('image') &gt; -1) {
              var fileReader = new FileReader();
              fileReader.readAsDataURL($files[j]);
              var loadFile = function(fileReader, index) {
                  fileReader.onload = function(e) {
                      $timeout(function() {
                          $scope.dataUrls[index] = e.target.result;
  
                          //------Suggestions?-------//
                          $('#image-upload-landscape').on('load', function(){
                              console.log($(this).width());
                          });
                          //-------------------------//
                      });
                  };
              }(fileReader, j);
          }
          $scope.progress[j] = -1;
          if ($scope.uploadRightAway) {
              $scope.start(j);
          }
  
      }
  };
  </code></pre>