/**
* @desc SVG转PNG
* @param {Object} obj
* @param {Number} obj.scale 缩放
* @param {Number} obj.length 长度
* @param {String} obj.src 图片路径
* @param {Boolean} obj.base64 输出数据类型是否 base64
* @param {Function} obj.success 成功回调
* @param {Function} obj.error 失败回调
*/
function dealImage(obj) {
var img = new Image();
img.src = obj.src;
img.onload = function () {
// 默认按比例压缩
var w = this.width,
h = this.height,
scale = w / h;
if (obj.length) {
if (w > h) {
w = obj.length;
h = (w / scale);
} else {
h = obj.length;
w = (h * scale);
}
} else {
w = obj.width || w;