title: resize image using javascript
body: <p>I'm using javascript function to input image.</p>
  
  <p>This is my HTML:</p>
  
  <pre><code>&lt;input type="file" name="filUpload" id="filUpload" onclick="" onchange="showimagepreview(this)"&gt;
  &lt;br /&gt;
  &lt;div id="before"&gt;
  &lt;img id="imgprvw" alt="" class="img-thumbnail" style="width: 250px; height: 250px;" /&gt;
  </code></pre>
  
  <p>And this is my JavaScript:</p>
  
  <pre><code>function showimagepreview(input) { //image preview after select image
    if (input.files &amp;&amp; input.files[0]) {
      var filerdr = new FileReader();
      filerdr.onload = function(e) {
        url = e.target.result;
        image = url;
        $('#imgprvw').attr('src', url);
        //console.log(url);
  
        //$('#imgprvw').attr('src', e.target.result);
        //url = e.target.result;
        //$("#imgpath").val(url);
      }
      filerdr.readAsDataURL(input.files[0]);
    }
  }
  </code></pre>
  
  <p>This code convert image to bite array, I need to resize my image using that bite array. Is there any possible methods to do it.</p>
  
  <p>I will pass that binary array to web service. I the image size too high, it takes much time, that's why I need to convert.</p>