Posted on: 12/16/2015 10:09:25 PM | Views : 1425

Hi. I'm using jasny-bootstrap.js to resize image and then to upload. But I'm getting the same size of image, because I could not bind them. Please help me.
<script src="jasny-bootstrap.js" type="text/javascript"></script> <script type ="text/javascript"> function resizeImage(input) { var filesToUpload = input.files; var file = filesToUpload[0]; var img = document.createElement("img"); var reader = new FileReader(); reader.onload = function (e) { img.src = e.target.result } reader.readAsDataURL(file); // reader returns null (actually, "e" is returning null here) var canvas = document.createElement('canvas'); var ctx = canvas.getContext("2d"); ctx.drawImage(img, 0, 0); var MAX_WIDTH = 80; var MAX_HEIGHT = 60; var width = img.width; var height = img.height; if (width > height) { if ...

Go to the complete details ...