获取图片的实际尺寸

var img = $("#j-preview-img");
        var relratio, twidth, theight;
        $("<img/>").attr("src", $(img).attr("src")).load(function() {
            twidth = this.width;
            theight = this.height;
            relratio = (twidth/theight).toFixed(2);
            //获取图片比例
        })    
原文地址:https://www.cnblogs.com/snowbaby-kang/p/4463003.html