I am building an image resize/crop, and I\'d like to show a live preview after they\'ve edited it in a modal (bootstrap). This should work, I believe, but I just ge
For me the solution of Austin didn't work, so I present the one worked for me:
var reader = new FileReader;
reader.onload = function() {
var image = new Image();
image.src = reader.result;
image.onload = function() {
alert(image.width);
};
};
reader.readAsDataURL(this.files[0]);
And if you find that assignment image.src = reader.result;
takes place after image.onload a bit wired, I think so too.