function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
//$('#userpicImage').attr('data-test', e.width.result + 'px');
$('#userpicImage').attr('style', 'background-image: url('+ e.target.result +')');
};
reader.readAsDataURL(input.files[0]);
}
}
reader.onload = function() {
......
var image = new Image();
image.src = reader.result;
image.onload = function(){
console.log(this.width, this.height);
}
}