title: javascript not getting correct image width and height
body: <p>I have added multiple image upload to my site using HTML api's. I have to test each images while uploading, whether they tall (height>width) or long(height
  
  <pre><code>&lt;script type="text/JavaScript"&gt;
  function filesProcess(files) 
  {
    var shape=document.getElementById('shapeval').value;
    for( var i = 0; i &lt; files.length; i++) 
      {
          file = files[i];
          if(!file.type.match(/image.*/)) 
              {
  
  
              alert('File name '+file.name+' is not allowed! Please try again!');
  
              window.location.reload(true);
  
                  continue; //Jump forward to the next file...
  
                  }
        else
          { 
                  var iw=document.images[i].width;
              var ih=document.images[i].height;
              var n=document.images[i].name;
              if(shape="tall")
                  {
  
                      alert("width:"+iw+" and height:"+ih);
                  }
                  else
                  {
  
                      alert("width:"+iw+" and height:"+ih);
                  }
              continue;
          }
  
      }
  
  
  }
   &lt;/script&gt;
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>  &lt;form action="upload.php/" method="post" enctype="multipart/form-data" name="uploadForm" onsubmit="return(validate());"&gt;
    &lt;input type="file" id="files" name="files[]" multiple  onchange="filesProcess(this.files);" accept="image/*"/&gt;
     &lt;input type="hidden" name="shapeval" id="shapeval" value="tall" /&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>Using this code width and height are displaying, but the value of them are not correct. Most of the time it's showing 182 and 51 for both type of images; So I couldn't recognize the images are tall or long? Where I did mistake? Am I missing something?Anyone have any idea?? </p>
  
  <p>Thanks!</p>