How to detect dimensions of file using File API and Dropzone.js
问题 Using Dropzone.js, I need to detect the dimesions of the image when added files and apply them to its parent .details div. The following code code works and return an alert with the added image width. myDropzone.on("addedfile", function(file, xhr) { var fr; fr = new FileReader; fr.onload = function() { var img; img = new Image; img.onload = function() { return alert(img.width); }; return img.src = fr.result; }; return fr.readAsDataURL(file); }); The thing is that I have no idea how to assign