function createReader(file, whenReady) {
var reader = new FileReader;
reader.onload = function(e) {
var image = new Image();
image.onload = function() {
var width = this.width;
var height = this.height;
if (whenReady) whenReady(width, height);
};
image.src = e.target.result;
};
reader.readAsDataURL(file);
}
网友评论